+ 1

What I have done wrong

h="yes" while h=="yes": n=int(input("Enter the first number")) m=int(input("Enter yhe second number")) o=input("Enter any operator") if o=="+": print(n+m) elif o=="-": print(n-m) elif o=="*": print(n*m) elif o=="/": print(n/m) h=input("Do you want to continue") if h=="n": print("Thanks for using‚by Tech")

4th Mar 2023, 4:05 PM
TECH
7 Respuestas
+ 6
Are you running this code in SoloLearn? FYI SoloLearn Code Playground does not support interactive input/output. Your code requires input in a loop, thus it's rather tricky to run in SoloLearn. Please add Python in the post tags for relevance sake.
4th Mar 2023, 4:16 PM
Ipang
+ 6
Your code is running and you want to program run infinity when the user want but it can't be possible on sololearn app or any other simple online compiler. You can try on repelit or if you use computer then try on VS code.
4th Mar 2023, 4:25 PM
Sakshi [Offline 🙃]
Sakshi [Offline 🙃] - avatar
+ 3
Sakshi what is replit? are you talking about online IDE replit or does it mean something else?
4th Mar 2023, 6:15 PM
Sandeep
Sandeep - avatar
+ 2
Sakshi thanks for the clarification! :)
4th Mar 2023, 6:26 PM
Sandeep
Sandeep - avatar
+ 2
Thank you so much guys👏👏👏
4th Mar 2023, 11:39 PM
TECH
+ 1
Sandeep yaa, I was talk about IDE repelit
4th Mar 2023, 6:20 PM
Sakshi [Offline 🙃]
Sakshi [Offline 🙃] - avatar
+ 1
There seem to be a couple of issues with this code: Indentation: In Python, indentation is used to denote the scope of code blocks. However, the code block inside the while loop is not properly indented. The code inside the while loop should be indented by four spaces or one tab. Typo: There is a typo in the second input statement where yhe is used instead of the. This will cause a NameError to be raised when the code is executed.
6th Mar 2023, 12:47 PM
Ghns up
Ghns up - avatar