sorting - Python list sort in descending order -


how can sort list in descending order?

timestamp = [     "2010-04-20 10:07:30",     "2010-04-20 10:07:38",     "2010-04-20 10:07:52",     "2010-04-20 10:08:22",     "2010-04-20 10:08:22",     "2010-04-20 10:09:46",     "2010-04-20 10:10:37",     "2010-04-20 10:10:58",     "2010-04-20 10:11:50",     "2010-04-20 10:12:13",     "2010-04-20 10:12:13",     "2010-04-20 10:25:38" ] 

timestamp.sort(key=lambda x: time.strptime(x, '%y-%m-%d %h:%m:%s')[0:6],     reverse=true) 

Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

html - Instapaper-like algorithm -

c# - How to execute a particular part of code asynchronously in a class -