"""File: recursive_hello0.py Purpose: Try to illustrate recursion by printing "hello" a user-specified number of times. Run: python recursive_hello0.py Input: Number of times to print hello Output: Should be "hello" the user-specified number of times Note: This has a serious bug """ def say_hello(total, so_far): """If so_far < total, print "hello" and call say_hello. Otherwise return""" print "hello", so_far so_far = so_far + 1 say_hello(total, so_far) #---------------------------------------------------------------------- # Main program how_many = int(raw_input("How many hellos?\n ")) say_hello(how_many, 0)