0
How do I keep on asking for an input when a loop doesn't accept it through conditional?
https://code.sololearn.com/cgkSBW6776eF/?ref=app My professors says using another loop inside a loop will cause the program to be slower. Is there any way to keep asking for an input when they entered greater than 100 and still be on the same loop without iteration? For example, if it's the first loop, x=0 and they entered 101, it should stay at x=0 but will ask an input again. I hope that's clear. Thank you!
4 Réponses
+ 1
you're itterating with x right ? just modify the value of x so it'll same after the increment in the next iteration.
+ 2
Try including x-- inside the else.
0
Avinesh Good Thought! Thanks. I'll try.