Skip to content

Commit b65d764

Browse files
committedFeb 20, 2015
Minor style change
1 parent 178e62b commit b65d764

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed
 

‎combinatorics.py

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ def permute(current, rest):
1818
if rest == []:
1919
result.append(current)
2020
return
21+
2122
for r in rest:
2223
permute(current + (r,), [i for i in rest if i != r])
2324

@@ -40,6 +41,7 @@ def _subsets(current, rest):
4041
_subsets((), lst)
4142
return result
4243

44+
4345
if __name__ == "__main__":
4446
print("Permutations of ['a','b','c']:", permutations(['a','b','c']))
4547
print("Subsets of ['a','b','c']:", subsets(['a','b','c']))

0 commit comments

Comments
 (0)