diff --git a/Week4/Week 4 Programming Assignment 2.py b/Week4/Week 4 Programming Assignment 2.py new file mode 100644 index 0000000..c5e640a --- /dev/null +++ b/Week4/Week 4 Programming Assignment 2.py @@ -0,0 +1,23 @@ +def fact(num): + + product=1 + + while(num>1): + + product*=num + + num-=1 + + return product + +m=int(input()) #m=men + +n=int(input()) #n=women + +if m+n>20 or m<=n: + + print('invalid',end="") + +else: + + print(fact(m)*fact(n)*fact(m+1)//(fact(n)*fact(m+1-n)),end="") \ No newline at end of file