0
Python - printing sorted lists
Hi, Why does the first printing not output a sorted list, but a None instead? The second printing works. a = [4,2,3,1] print (a.sort()) a.sort() print (a) Output: None [1,2,3,4] Please help.
5 Respostas
+ 1
Ok, why print(a.sort()) is implicit and print(sorted(a)) is explicit?
0
If I understand it correctly,
Print + method -> None
Print + function -> value, iterator etc.