list.sort(key=len) sorted(iterable, key=str.lower)

Documentation » Python HOWTOs » Sorting HOW TO
https://docs.python.org/3/howto/sorting.html

l4 = sorted(l4, key=lambda concept: (concept[0].lower(), concept[1])
http://stackoverflow.com/questions/10269701/case-insensitive-list-sorting-without-lowercasing-the-result

https://developers.google.com/edu/python/sorting

http://stackoverflow.com/questions/4659524/how-to-sort-by-length-of-string-followed-by-alphabetical-order

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s