def stars(num): """ Return a string containing num stars. This could also be done with "*" * num, but that doesn't demonstrate local variables. >>> print stars(5) ***** >>> print stars(15) *************** """ starline = "" for i in range(num): starline = starline + "*" return starline num = int(raw_input("How many lines should I print? ")) for i in range(num): print stars(i+1)