import random def rnd(len): return random.randrange(len) def encounter(route): return route[rnd(len(route))]