Objective
Create a Python program that calculates in how many ways k elements can be chosen from n, with and without regard to order.
Instructions
- Read two integers,
nandk(with0 ≤ k ≤ n), one per line. - Show
Combinations: C, the ways to choose without regard to order (math.comb). - Show
Permutations: P, the ways to choose and arrange (math.perm).
5
2
Combinations: 10
Permutations: 20
Open the editor in full screen: the statement on the left and your code, the output and the tests on the right.
Start exercise