0
I want to know why this code line goes into a loop?
https://code.sololearn.com/cjQNPivtW0zm? ref=app This was a question I came across. Indeed, I was expecting it to end up with an error.
3 Réponses
+ 1
What's your question ? It doesn't run into a loop, and you already know it should output an error, so what is it you want exactly ?
+ 1
First of all there is error in your code
Make line 2 - while num in range(6):
It goes into a loop because 5 is within the range of 6 and while loop is true forever.
0
Sorry guys I forgot to write "num" . And thank you Avinesh P for your answer. I got it.