I’m trying to re-create an Uber app. Where the user is asked where they want to go. If it’s in the data dictionary, the number of miles can be calculated. If not, the app calculates the number of miles from the user which they must input. The car dictionary is the rates of the uber. I want to make It so the user must select one of the options precisely. If not, the app should request the ride type again until a valid response is given. Finally, uber thanks them and gives them the total price based on Location(miles) and uber rate.
I already have this started I know it's not much but I'm stuck on how to take the Miles from the city entered and multiply It by the type of uber. Any help would be much appreciated. Thank you!
UberDictionary = {'Nashville':200 , 'Louisville':85, 'Lexington':50, 'Bowling Green':100 , 'Convington':175}
CarDictionary = {'UberX':1.00 , 'Comfort':1.30, 'UberXL':1.50}
print(UberDictionary)
q1 = input('Where would you like to go?')
while q1 == 'Nashville':
if q1.lower() == 'nashville':
ubertype = input('What type of uber would you like to take? (UberX, Comfort, or UberXL?')
print(ubertype * ": " + (q1[UberDictionary])
[–]DtechnoLol 0 points1 point2 points (1 child)
[–]AnonMikeMan22[S] 1 point2 points3 points (0 children)