def get_end(): end_point_letter = input("Ok, where are you headed? Type in the corresponding letter: ") if end_point_letter not in landmark_choices.keys(): print("Sorry, that's not a landmark we have data on. Let's try this again...") get_end() else: return landmark_choices[end_point_letter]
def get_start(): start_point_letter = input("Where are you coming from? Type in the corresponding letter: ") if start_point_letter not in landmark_choices.keys(): print("Sorry, that's not a landmark we have data on. Let's try this again...") get_start() else: return landmark_choices[start_point_letter]
def get_end(): # gets endpoint from user input end_point_letter = input("Ok, where are you headed? Type in the corresponding letter: ") if end_point_letter in landmark_choices.keys(): end_point = landmark_choices[end_point_letter] print("End point: {0}\n".format(end_point)) return end_point else: return get_end()
def get_end(): end_point_letter = input( "Where are you headed? Type in the corresponding letter: ") if end_point_letter in landmark_choices.keys(): end_point = landmark_choices[end_point_letter] return end_point else: print("That is not a valid letter.") return get_end()
def get_end(): end_point_letter = input("Where are you headed?\nType in the corresponding letter: ").lower() if end_point_letter in landmark_choices.keys(): end_point = landmark_choices[end_point_letter] return end_point else: print("Sorry, that's not a landmark we have data on.\n") show_landmarks() get_end()
def get_start(): start_point_letter = input("Where are you coming from?\nType in the corresponding letter: ").lower() if start_point_letter in landmark_choices.keys(): start_point = landmark_choices[start_point_letter] return start_point else: print("Sorry, that's not a landmark we have data on.\n") show_landmarks() get_start()
def get_start(): start_point_letter = input( "Where are you coming from? Type in the corresponding letter: ") if start_point_letter in landmark_choices.keys(): start_point = landmark_choices[start_point_letter] return start_point else: print("Sorry, that is not a valid letter.") return get_start()
def get_start(): # gets startpoint from user input start_point_letter = input("Where are you coming from? Type in the corresponding letter: ") if start_point_letter in landmark_choices.keys(): start_point = landmark_choices[start_point_letter] print("Start point: {0}\n".format(start_point)) return start_point elif start_point_letter == "admin": return "admin" else: print("Sorry, that's not a landmark we have data on. Let's try this again...") return get_start()
def get_end(): end_point_letter = input( 'where are you headed? type in the corresponding letter: ') if end_point_letter in landmark_choices.keys(): end_point = landmark_choices[end_point_letter] else: print( "Sorry, that's not a landmark we have data on. Let's try this again..." ) end_point = get_end() return end_point
def get_end(): end_point_letter = input( "Ok, where are you headed? Type in the corresponding letter: ") if end_point_letter in landmark_choices.keys(): end_point = landmark_choices[end_point_letter] print("You selected {} as your destination.".format(end_point)) return end_point else: print( "Sorry, that's not a landmark we have data on. Let's try this again" ) get_end()
def get_start(): start_point_letter = input( "Where are you coming from? Type in the corresponding letter: ") if start_point_letter in landmark_choices.keys(): start_point = landmark_choices[start_point_letter] print("You selected {} as your starting point.".format(start_point)) return start_point else: print( " Sorry, that's not a landmark we have data on. Let's try this again" ) get_start()
def get_end(): end_point_key = input( 'Ok, where are you headed? Type in the corresponding letter:') end_point_key = end_point_key.lower() if end_point_key in landmark_choices.keys(): end_point = landmark_choices[end_point_key] else: print( "Sorry, that's not a landmark we have data on. Let's try this again..." ) get_end() return end_point
def get_start(): start_point_key = input( 'Where are you coming from? Type in the corresponding letter: ') start_point_key = start_point_key.lower() if start_point_key in landmark_choices.keys(): start_point = landmark_choices[start_point_key] else: print( "Sorry, that's not a landmark we have data on. Let's try this again..." ) get_start() return start_point
def get_start(): start_point_letter = input( 'where are you coming from? type in the corresponding letter: ') if start_point_letter in landmark_choices.keys(): start_point = landmark_choices[start_point_letter] else: print( "Sorry, that's not a landmark we have data on. Let's try this again..." ) start_point = get_start() return start_point
def get_end(): end_pointer_letter = input( "\nWhere are you heading to\nType in the corresponding letter: " ).lower() while end_pointer_letter not in landmark_choices.keys(): print(""" Sorry, that's not a landmark we have data on. Let's try this again...""") return get_end() return end_pointer_letter
def get_start(): start_pointer_letter = input( "\nWhere are you coming from?\nType in the corresponding letter: " ).lower() while start_pointer_letter not in landmark_choices.keys(): print(""" Sorry, that's not a landmark we have data on. Let's try this again...""") return get_start() return start_pointer_letter
def get_start(): # collect user input start_point_letter = input("Where are you coming from? Type in the corresponding letter: ") # make sure the user entered a real landmark name if start_point_letter in landmark_choices.keys(): # if it's a valid choice we can set start_point using the landmark_choices dictionary start_point = landmark_choices[start_point_letter] # the function returns the start_point return start_point else: # if the choice is not valid print("Sorry, that's not a landmark we have data on. Let's try this again...") # return a recursive call so that the user gets a chance to get it right return get_start()
def get_end(): end_point_letter = input( "Ok, where are you headed? Type in the corresponding letter: ") if end_point_letter in landmark_choices.keys(): end_point = landmark_choices[end_point_letter] return end_point
from graph_search import bfs, dfs from vc_metro import vc_metro from vc_landmarks import vc_landmarks from landmark_choices import landmark_choices # Comprehensible list of all tourist attractions numbered from A to Z landmark_string = "" for key in landmark_choices.keys(): landmark_string += (key + " - " + landmark_choices[key] + '\n') # list of inaccessible stations. These are removed from the metro graph stations_under_construction = ['Moody Centre', 'Olympic Village'] # opening function def greet(): print("Hi there and welcome to SkyRoute!") print( "We'll help you find the shortest route between the following Vancouver landmarks:\n" + landmark_string) # Main wrapper for SkyRoute def skyroute(): greet() new_route() goodbye() # if start and end is not set it returns them. If they are set the user can choose to update start, end, or both def set_start_and_end(start_point, end_point):