0
Help me please.
while True: print("Enter'+'to add two numbers") print("Enter'-'to subtract two numbers") print("Enter'*'to multiply two numbers") print("Enter'/'ti divide two numbers") print("Enter'quit'to end the programm") user_input=input("") if user_input=="quit": break elif user_input =="+": a=fload(input("Enter number:")) b=fload(input("Enter another number:")) print=str(a+b) break:outside loop
3 odpowiedzi
+ 12
1. print( ) is not a variable, syntax is wrong.
2. "float" not "fload".
You have to find an alternative way to break the program, i've some doubt you can break a program in runtime with Sololearn so i'm not the right person to do that, but i can fix your bugs.
https://code.sololearn.com/cz0tzy2XMlZB/?ref=app
+ 2
Indentation is very important while iterating in python.
Indent your code carefully and datatype is float ..try this
corrected code:
https://code.sololearn.com/cVyfJGocsxC0
+ 1
Thank you very much for your help