Skip to content

Commit

Permalink
assignment 2
Browse files Browse the repository at this point in the history
  • Loading branch information
kishanrajput23 authored Feb 9, 2021
1 parent 7364fa0 commit 3f82236
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions Week4/Week 4 Programming Assignment 2.py
Original file line number Diff line number Diff line change
@@ -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="")

0 comments on commit 3f82236

Please sign in to comment.