What is the output of print([3, 1, 2].sort()) in Python?
print([3, 1, 2].sort())
Correct answer
D. None
8 views
D. None
8 views
sort() sorts in place and returns None, a common beginner mistake.
Asked in: Python Interview Lists
https://docs.python.org/3/tutorial/datastructures.htmlNot sure why the answer is D? Ask here and get an explanation.