What is the output of print([3, 1].sort() == [1, 3]) in Python?
print([3, 1].sort() == [1, 3])
Correct answer
C. False
7 views
C. False
7 views
list.sort() returns None, so the comparison is False.
Asked in: Python Interview Lists
https://docs.python.org/3/tutorial/datastructures.htmlNot sure why the answer is C? Ask here and get an explanation.