30-Days-Of-Python
30-Days-Of-Python copied to clipboard
Bug in code loop example
hey Asabeneh ,
https://github.com/Asabeneh/30-Days-Of-Python/blob/master/10_Day_Loops/10_loops.md on this day you write a example of continue in loop
count = 0
while count < 5:
if count == 3:
continue
print(count)
count = count + 1
you say about result "The above while loop only prints 0, 1, 2 and 4 (skips 3)." but result is infinite loop after print 2 because you don't add to count anything in if block
count = 0
while count < 5:
if count == 3:
count = count + 1
continue
print(count)
count = count + 1
thanks you for share this good resource for learning python .