Predict the output
What does this print?
from math import comb, factorial
print(2 ** 20, factorial(10), comb(20, 10))Choose an answer, then open Show answer below to check it.
Show answer
Answer: A 1048576 3628800 184756
Right: these three are the usual 'still fine' sizes for listing.
Knowing these magnitudes lets you judge in seconds whether listing everything fits a time limit.
Why not the others?
- B 1048576 362880 184756. That is 9!, not 10!.
- C 1000000 3628800 184756. 2²⁰ is a little over a million.