Friday, August 23, 2013

python get longest string in list

mylist = ['1','22','333']
print max(mylist, key=len)

No comments:

Post a Comment