What is the output of print(list(reversed([3, 2, 1]))) in Python?
print(list(reversed([3, 2, 1])))
Correct answer
C. [1, 2, 3]
6 views
C. [1, 2, 3]
6 views
reversed() returns an iterator over the sequence in reverse order.
Asked in: Python Interview Advanced
https://docs.python.org/3/library/index.htmlNot sure why the answer is C? Ask here and get an explanation.