Answers for "paython for loop"

6

python for loop

words=['zero','one','two']
for operator, word in enumerate(words):
	print(word, operator)
Posted by: Guest on March-19-2020
0

python for loop

#an object to iterate over 
items = ["Item1", "Item2", "Item3", "Item4"]

#for loop using range  
for i in range(len(items)):
  	print(items[i])
    
#for loop w/o using range    
for item in items:
  	print(item)
Posted by: Guest on November-01-2020

Python Answers by Framework

Browse Popular Code Answers by Language