Write the counting formulas yourself, and test them against a computer that lists every arrangement.
The idea. . Listing with itertools.permutations must give the same number.
Your tasks.
factorial, return with a loop. Remember that .npr, return as a product of factors. Do not use factorial.by_listing, return how many arrangements of of the items there are, by listing them.Have you tried it?
Do the tasks in the editor first, and run the checker after each one. Its hints help when a check fails. When you are ready, compare your code with this solution.
Log in to join the discussion.
Loading…
With Standard, you also open 12 more problems, 2 Python labs and 1 extra course. Everything you have used here stays free, always.