What is the output of the following Python code snippet?
from itertools import permutations
print(len(list(permutations([1, 2, 3]))))
print(len(list(permutations([1, 2, 3]))))
Correct answer
C. 6
C. 6
permutations of three items gives 3! = 6 arrangements.
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.