0
Why this code doesn't work?
while True: print ("welcome\ntype add, subtract, divide or multiply") z = input(": ") if z == "add": print ("enter first number") x = float(input(": ")) print ("enter second number") y = float(input(": ")) print (x+y) elif z == subtract: print ("enter first number") x = float(input(": ")) print ("enter second number") y = float(input(": ")) print (x-y) elif z == divide: print ("enter first number") x = float(input(": ")) print ("enter second number") y = float(input(": ")) print (x/y) elif z == multiply: print ("enter first number") x = float(input(": ")) print ("enter second number") y = float(input(": ")) print (x*y) else: print ("invalid input")
6 ответов
+ 1
Okay, thank you very much.
0
Thank you. I wrote add 1 2 in different lines during input and it gave me 3.0. But at the end there was an Eof error for line 3. What is eof error?
0
So the code is alright? Is it just sololearn limitations?