+ 1
I Get Error When I Run This Code...Why?
float(input("Enter a number: ")) + float(input("Enter another number: ")) Enter a number: 40 Enter another number: 2
7 Answers
+ 9
Abdul Sultan
Yes its not giving any errors just use print statement to print the sum of numbers.
print(float(input("Enter a number: ")) + float(input("Enter another number: ")))
+ 9
Abdul Sultan if you are doing that in python then try this way.
a=float(input("Enter a number: "))
b=float(input("Enter another number: "))
c=a+b
print(c)
+ 1
Thank you. I didn't notice the print statement was omitted GAWEN STEASY
0
GAWEN STEASY I actually expected no error because that code is from a python lesson under #type-conversion.
0
Ok
0
Yu oo
0
Bro it is simple when u input u type (3 4)
So this input is taken as a string
So u must input
(3
4)
i.e input a no and press enter or leave a line then input 2nd no