# File: ChapterControl/looplist.py """Title: Loop a list (sequence) 2 3 9 5 72 3 9 5 7 [2, 3, 9, 5, 7] """ import sys def myfunc(L): # print each element of a list for i in L: print(i) # on each line def main(): seq = [ 2, 3, 9, 5, 7] for i in seq: sys.stdout.write( "%4d" % i ) print myfunc(seq) # another way to print list print(seq) # better main()