for car in cars[1:]:
# The [1:] specifies to start at the second loop because 0 = 1 in lists.
skipcount = -1
song = ['always', 'look', 'on', 'the', 'bright', 'side', 'of', 'life']
for sing in song:
if sing == 'look' and skipcount <= 0:
print sing
skipcount = 3
elif skipcount > 0:
skipcount = skipcount - 1
continue
elif skipcount == 0:
print 'a' + sing
skipcount = skipcount - 1
else:
print sing
skipcoun
for i in range(1,11):
if i==5:
continue
print (i)
nums = [7,3,-1,8,-9]
positive_nums = []
for num in nums:
if num < 0: #skips to the next iteration
continue
positive_nums.append(num)
print(positive_nums) # 7,3,8
# program to display only odd numbers
for num in [20, 11, 9, 66, 4, 89, 44]:
# Skipping the iteration when number is even
if num%2 == 0:
continue
# This statement will be skipped for all even numbers
print(num)