0
Help with type conversion
I tried running this example but it is giving me error. could somebody please please explain to me what's wrong with it? print(float(input("Enter a number: ")) + float(input("Enter another number: ")))
2 Réponses
+ 2
Wrap the addition operation of your floats with a format() so that it is ready for the print operation.
print(format(float(input("Enter a number: "))+float(input("Enter another number: "))))
EDIT: Ran on Windows(v3) and Linux (v2) consoles and both versions worked as written. Where were you trying to run this?
0
I get EOFError. I think it might be the compiler of the app, I haven't tried it in a pc.