baffling Python error msg | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

baffling Python error msg

when I tried to run the following code: print(float(input("enter a number: ")) + float(input("enter another number: "))) I keep getting the following error msg. Can anyone please clarify? Enter a 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:

29th Apr 2019, 10:46 AM
Kean Chong
Kean Chong - avatar
1 Answer
+ 1
works fine for me, whats your input maybe thats the problem. python use dot ( . ) as seperator not comma ( , )
29th Apr 2019, 11:15 AM
Taste
Taste - avatar