Code for Life
Search…
Python Commands
Useful Python commands to use at the latter levels of Rapid Router
Run the following commands on the van object v, e.g. my_van.move_forwards()

Movement

1
my_van.move_forwards()
2
my_van.turn_left()
3
my_van.turn_right()
4
my_van.turn_around()
5
my_van.wait()
Copied!

Position

1
my_van.at_dead_end()
2
my_van.at_destination()
3
my_van.at_red_traffic_light()
4
my_van.at_green_traffic_light()
5
my_van.at_traffic_light(c)
6
# where c is 'RED' or 'GREEN'
Copied!
1
my_van.is_road_forward()
2
my_van.is_road_left()
3
my_van.is_road_right()
4
my_van.is_road(d)
5
# where d is 'FORWARD', 'LEFT', or 'RIGHT'
Copied!
Export as PDF
Copy link