On 4/21/2012 22:26, GrayShark wrote:
----------------------- #!/usr/bin/pythonxl = ["First Name and Last","ENGR 109-X","Fall 2999","Format Example"] xl_max = 0 for x in xl: xl_max = max ( len( x ), xl_max )
Or xl_max = max([len(x) for x in xl])
topBorder = '^'*( xl_max + 4 ) print topBorder for x in xl: print "* %s%s *" % ( x, ' '*(xl_max - len( x )) )
Or print "* %-*s *" % (xl_max, x) I hope you don't mind. Kiuhnm -- http://mail.python.org/mailman/listinfo/python-list