[Tutor] What's the difference between sort(aList) and aList.sorted()

Steven D'Aprano steve at pearwood.info
Wed Jul 26 22:16:08 EDT 2017


On Wed, Jul 26, 2017 at 10:03:59PM -0400, C W wrote:
> Thank you very much, all!
> 
> One other question: how do you look up a method?

Any of these will work:

help(list.sort)

help([].sort)

alist = [1, 2, 3, 99]
help(alist.sort)




-- 
Steve


More information about the Tutor mailing list