What am I doing wrong in this loop!? /u/Bean_ziggler2 Python Education

I’m am a beginner and have only been learning python for a short while. I decided to make a very basic calculator and i want it to ask if you would like to calculate another number than loop. But for some reason i could only ever get it to loop no matter what i put or not loop at all

while True: first = int(input("Enter first number: ")) sign = input("Enter sign (+ - * /): ") second = int(input("Enter second number: ")) if sign == "+": result = first + second print(result) if sign == "-": result = first - second print(result) if sign == "*": result = first * second print(result) if sign == "/": result = first / second print("Result: ", result) command = "" input("Would you like to calculate another number? Yes or No? ") if command.lower != "yes": break 

submitted by /u/Bean_ziggler2
[link] [comments]

​r/learnpython I’m am a beginner and have only been learning python for a short while. I decided to make a very basic calculator and i want it to ask if you would like to calculate another number than loop. But for some reason i could only ever get it to loop no matter what i put or not loop at all while True: first = int(input(“Enter first number: “)) sign = input(“Enter sign (+ – * /): “) second = int(input(“Enter second number: “)) if sign == “+”: result = first + second print(result) if sign == “-“: result = first – second print(result) if sign == “*”: result = first * second print(result) if sign == “/”: result = first / second print(“Result: “, result) command = “” input(“Would you like to calculate another number? Yes or No? “) if command.lower != “yes”: break submitted by /u/Bean_ziggler2 [link] [comments] 

I’m am a beginner and have only been learning python for a short while. I decided to make a very basic calculator and i want it to ask if you would like to calculate another number than loop. But for some reason i could only ever get it to loop no matter what i put or not loop at all

while True: first = int(input("Enter first number: ")) sign = input("Enter sign (+ - * /): ") second = int(input("Enter second number: ")) if sign == "+": result = first + second print(result) if sign == "-": result = first - second print(result) if sign == "*": result = first * second print(result) if sign == "/": result = first / second print("Result: ", result) command = "" input("Would you like to calculate another number? Yes or No? ") if command.lower != "yes": break 

submitted by /u/Bean_ziggler2
[link] [comments] 

Leave a Reply

Your email address will not be published. Required fields are marked *