I am starting to learn Python.
Can someone explain why sort() returns None?
alist.sort() ## correct alist = blist.sort() ## NO incorrec
alist.sort() sorts alist in-place, modifying alist itself.
alist.sort()
alist
If you want a new list to assign somewhere, use blist = sorted(alist)
blist = sorted(alist)
list.sort()
sorted()