Running this code requests for one number then displays an error: print(float(input("Enter a number: ")) + float(input("Enter | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Running this code requests for one number then displays an error: print(float(input("Enter a number: ")) + float(input("Enter

This is the error: Enter a number: Enter another number: Traceback (most recent call last): File "..\Playground\", line 1, in <module> \ufeffprint(float(input("Enter a number: ")) + float(input("Enter another number: "))) ValueError: could not convert string to float:

2nd May 2019, 12:47 PM
Wyke Isaji
3 Answers
+ 3
The provided line of code works fine. Can you provide the whole code
2nd May 2019, 12:55 PM
Seniru
Seniru - avatar
+ 3
Wyke Isaji yep that works
2nd May 2019, 1:38 PM
Seniru
Seniru - avatar
0
print(float(input("Enter a number: ")) + float(input("Enter another number: ")))
2nd May 2019, 1:08 PM
Wyke Isaji