Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- #Python 2.7
- # make list to store destination
- name = []
- # So that the starting of the loop would always be home
- name.append("your HOME")
- #make list to store direction
- new = []
- # Go through 5 times
- for i in range (5):
- #i = 1
- # Get the inputs
- direction = raw_input ("Enter Direction (left/right): ")
- # Set the direction to be in letters
- if direction in ("L", "l", "left"):
- result = "Turn right"
- if direction in ("R", "r", "right"):
- result = "Turn left"
- destination = raw_input ("Enter Destination: ")
- # When school is inputted stop the loop
- if destination.upper() == "SCHOOL":
- break
- # Add to the list all destination inputs
- name.append (destination + " street")
- # Add all directions
- new.append(result)
- # Reverse the list for the destination
- # Reverse the list for the direction
- new = new[::-1]
- name = name[::-1]
- for i in range (len(name)):
- print new[i-1]+" into "+name[i]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement