-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Hakan
authored and
Hakan
committed
Jul 21, 2020
1 parent
d833e91
commit 74e39d4
Showing
2 changed files
with
11 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# daily-python-challenge | ||
# Define a “function” to calculate permutation of 2 numbers. | ||
# Reminder: P(n,r) = n!/(n-r)! | ||
# Clue: Defining a function that calculates factorial of given number, may be helpful. | ||
|
||
from itertools import permutations | ||
def P(n,r): | ||
return len(list(permutations(range(n),r))) |