+ 1
I tried to use while loop in my previous calculator program. But it showing error in line 18
5 Réponses
+ 11
sathya some indentation errors in your code and x is not defined before use that cause program to bit executed. Here is updated code
https://code.sololearn.com/cdRKtHGfG24M/?ref=app
+ 10
sathya you can initialise with 0 to. As your code while loop condition is x<=5 so for 5 cases it will execute.
You can also use while condition in different ways like this one
contain = "y"
while contain == "y" or cont == "Y":
+ 1
GAWEN STEASY why we should initialize x as 1 .
+ 1
GAWEN STEASY thank u
0
GAWEN STEASY is there any way I could enter choice as many times but when x=5 . Loop stops .