# stringLoop.py # Neal 2009.10.15 # # Shows simple looping on a string sequence def stringLoop(s): for c in s: print 3*c, # stay on same line print # go to next line after the loop stringLoop("Spam!!!") def anotherStringLoop(s): for i in range(len(s)): print 6*s[i] # all on separate lines anotherStringLoop("Spam!!!")