Can someone help me with this | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Can someone help me with this

I am writing print(float(input("Enter a number:"))) + float(input ("Enter another number")) Enter a number: 5 Enter another number: 2 it is showing an error why

3rd May 2018, 3:29 PM
Surinder Kumar
Surinder Kumar - avatar
5 Answers
+ 6
https://code.sololearn.com/cVF2vhkAUPVW/?ref=app Enter two numbers. And it works fine
3rd May 2018, 4:08 PM
jay
jay - avatar
+ 5
Check your parentheses. print(float(input("Enter a number:")) + float(input ("Enter another number")))
3rd May 2018, 3:32 PM
jay
jay - avatar
+ 3
You could also separate the input calls and store the results into variables. Which would make for better code as you could check for missing values.
3rd May 2018, 4:17 PM
jay
jay - avatar
0
he is again showing an error by using this code.He shows an error in Enter a number:5
3rd May 2018, 3:57 PM
Surinder Kumar
Surinder Kumar - avatar