Adding the following long if statement
if 0 in route and 1 in route and 2 in route and 3 in route and 4 in route:before the print statement does the job. You don't really have to check that 0 is included because it is always the starting point but it's good programming style to rather do more checks than too few in order to ensure that the program works even if we modify it later.
a pro style tip: you can check that the route includes all ports (numbered 0, 1, ..., 4) easily by using Python sets. The clumsy if statement in the example solution can be replaced by the much more elegant one:
if set(route) == set(range(5)):