stopping a for loop python code example
Example 1: python get out of loop
while True:
print('I run!')
break
print('Not in loop!')
Example 2: how to skip number in while loop python
def skip_down(num, skip):
count = 0
lst = [0]
while count< num:
count = count + skip
lst.append(count)
return lst
print(skip_down(10, 3))
Example 3: break function python
if( x > 3):
print('X is greater than 3')
else:
break