Loops: permutation and combinations

O

Class work:

Some probability problems required the used of factorial in a different way.To calculate the number of sets that can be created from selecting in order r number of objects from n number of objects is:
Permutations
permutations
An example: reorder 5 books 2 at a time. Here n is 5 and r is 2.
Write a python program YI_permutations.py to calculate this number given n and r. Prompt the user for n and r.
combinations
Write a python program Combinations_YI.py to calculate this number given n and r. Prompt the user for n and r.