János Juhász wrote: > Dear Guys, > > I have a 2D array: > >>>>[['1', '2 ', '3 '], ['longer ', 'longer ', 'sort']] > > > > How can I get what is the max(len(item)) for the columns ? > I would like to get a list with the max_col_width values. > > I hope that, it can wrote with some nice list comprehension, but I can't do > that :(
Ah, thanks jfouhy for correctly understanding the question! If you are doing this because you want to pretty-print a table, you may be interested in this recipe: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/267662 Kent _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor