Exercise 1, Advanced
My code runs perfectly and it outputs the correct list, but when I try to run the test it complains that I can’t put >= between a list and and integer (which I’m not trying to). Is there something wrong that I don’t see?
portnames = ["PAN", "AMS", "CAS", "NYC", "HEL"]
def permutations(route, counter=1):
if counter>=len(route):
print(' '.join(route))
return
for s in range(counter,len(route)):
route[counter], route[s] = route[s],route[counter]
permutations(route, counter+1)
route[counter],route[s] = route[s], route[counter]
permutations(portnames)