#!/usr/bin/env python3 # demonstrates a while loop and a for loop #While Loop counter = 0 print("while loop:") while (counter < 5): print("The counter is ", counter) counter += 1 #For Loop print("\nfor loop") for i in range(0,5): print(i) #Fib-series example a, b = 0, 1 print('Fib-series') while b < 200: print(b) a, b = b, a+b words = ['Tunis','Gaborone','Nairobi','Dakar','Kampala'] for w in words: print('Characters in',w,'is', len(w))