To improve my previous post: no need to use list(). You can do sorted(set(tweetlist)).
On Mon, Nov 14, 2011 at 2:29 PM, Matt Jibson <[email protected]> wrote: > From http://docs.python.org/library/stdtypes.html#set-types-set-frozenset: > "A set object is an unordered collection" > > You can use set() to filter out duplicates. But then you need to > convert back to a list to be able to sort: > result = sorted(list(set(tweetlist))) > > On Mon, Nov 14, 2011 at 2:22 PM, pdknsk <[email protected]> wrote: >> http://shell.appspot.com/ >> >>>>> set([1,2,3,4,5,1,2]) >> set([1, 2, 3, 4, 5]) >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Google App Engine" group. >> To post to this group, send email to [email protected]. >> To unsubscribe from this group, send email to >> [email protected]. >> For more options, visit this group at >> http://groups.google.com/group/google-appengine?hl=en. >> >> > -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.
