23-Loop_through_words_and_lists_for_loop.py


Sign up Free. Don't forget to check out our challenges, lessons, solve and learn series and more ...


Code Snippet

for letter in 'Python':     # First Example
   print ('Current Letter :', letter)

fruits = ['banana', 'apple',  'mango', 'pear']
for fruit in fruits:        # Second Example
   print ('Current fruit :', fruit)

print ("Good bye!")
                    

Try it yourself