"""File: recursive_hello.py Purpose: Illustrate recursion by printing "hello" a user-specified number of times. Run: python recursive_hello.py Input: Number of times to print hello Output: "hello" the user-specified number of times """ def say_hello(total, so_far): """If so_far < total, print "hello" and call say_hello. Otherwise return""" if so_far < total: print "hello" 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)