>>> lst = [5,3,7,6,2]
 >>> lst.sort()
 >>> lst
[2, 3, 5, 6, 7]
 >>> lst = [5,3,7,6,2]
 >>> print lst.sort()
None
 >>> lst
[2, 3, 5, 6, 7]

I'm wondering why "print lst.sort()" doesn't print the newly sorted 
list, but instead prints "None". In fact, the sorting has taken place 
because of "print lst.sort()". Is this behavior a Good Thing in Python?

Dick

_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to