+ 2
print(float(input("Enter a number: ")) + float(input("Enter another number: ")))
I couldn't get how to enter details for code alert box displayed on screen the 2 different inputs
7 ответов
+ 3
thanks both of you
+ 2
try instead:
a = float (input ("Enter a number: "))
b = float (input ("Enter another number: "))
print (a + b)
It's better to sort out your variables line by line, and THEN manipulating them. Not only for readability, but it helps you not to get lost in your own code. Shoving everything into the same line just makes it harder on yourself.
+ 2
how to enter the input for program for example 2 4 or '2' '3'
+ 2
I'm not getting it
+ 2
will program not work properly on code playground
+ 1
The input function you used is how you retrieve data from the user. But keep in mind, on the code playground here on sololearn, you enter your inputs at the start only, since it is run server side.
0
In the playground when it asks for your input, enter the first number (or other type of input) press return/enter then enter the second number (repeat for however many inputs the program takes), then once all your inputs are entered click/tap submit.