mirror of
https://github.com/autistic-symposium/master-algorithms-py.git
synced 2025-04-29 12:16:14 -04:00
Update and rename permutation.py to permutations.py
This commit is contained in:
parent
0b6dbbaa27
commit
a4fe8d519e
@ -3,7 +3,7 @@
|
||||
# author: bt3gl
|
||||
|
||||
|
||||
def permutation(string) -> list:
|
||||
def permutations(string) -> list:
|
||||
|
||||
if len(string) == 1:
|
||||
return [string]
|
||||
@ -14,9 +14,3 @@ def permutation(string) -> list:
|
||||
result += [char + perm]
|
||||
|
||||
return result
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
print('Testing permutation()...')
|
||||
string = "bt3gl"
|
||||
print(f'Permutation of {string}: {permutation(string)}')
|
Loading…
x
Reference in New Issue
Block a user