... def avancer_obstacle(): while not obstacle(): avancer() def main(): for i in range(10): avancer_obstacle() tg() ...