Skip to content

Commit

Permalink
Update city_permutation.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Eduardo-Alanis-Garcia authored Dec 8, 2023
1 parent 7cfece2 commit 02de102
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions travelpy/city_permutation.py
Original file line number Diff line number Diff line change
@@ -1,7 +1 @@
from itertools import permutations

def city_permutation(cities):
"""Function that generates all the permutations of the cities to be traveled"""
all_permutations = permutations(range(1, cities))
for permutation in all_permutations:
yield (0,) + permutation + (0,)

0 comments on commit 02de102

Please sign in to comment.