Pass Statement in For Loops
Pass Statement in For Loops
my_list = ['computer', 'car', 'bottle', 'tv']
for item in my_list: # Will return an indentetion error if empty
pass # Used of later completion of code
# do other stuff
# do other code
# etc ...You can also have the list in the for loop directly:
for item in ['computer', 'car', 'bottle', 'tv']:
print(item)Last updated