why when i use editor for that code didn't print the result automatically and i shoud insert print function first the code is: float (insert('enter a number: ')) + float (insert(' enter another number: ')) when i use this code in IDLE the program prints the result automatically | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
0

why when i use editor for that code didn't print the result automatically and i shoud insert print function first the code is: float (insert('enter a number: ')) + float (insert(' enter another number: ')) when i use this code in IDLE the program prints the result automatically

the get a result in the editor after running the program the should be : print (float (insert('enter a number: ')) + float (insert(' enter another number: ')))

7th Jul 2016, 12:11 PM
Ahmed Kamal
Ahmed Kamal - avatar
3 Réponses
0
Do you mean something like: a = float(input('Enter a number: ')) b = float(input('Enter another number: ')) print(a) print(b)
7th Jul 2016, 2:13 PM
Dean
0
@Dean , No i mean when iam using the editor not IDLE i should change my code to be started with print to get my answer but if i use IDLE i shouldnt use print to get my answer does python interact with me only when i use IDLE and needs some change in code if i use the editor? sorry if my question is not clear enough
7th Jul 2016, 2:21 PM
Ahmed Kamal
Ahmed Kamal - avatar
0
IDLE is the editor mate. I think what you are using is the python shell within the IDLE interface. And no you don't need to use print to output a value on the shell as it automatically outputs all operations that return a value.
7th Jul 2016, 5:54 PM
Gershon Fosu
Gershon Fosu - avatar