Question: I need help with this assignment in python. The top part is the assignment, the part on the bottom is the output.Thanks! 7 Info2000 Airlines
I need help with this assignment in python. The top part is the assignment, the part on the bottom is the output.Thanks!
7 Info2000 Airlines Write a program that asks users for their destination from Athens and gives them the cost of a flight to get there (similar to the example we did in class on 2/7/2023). Complete the class exercise such that, if the user enters a destination that's not in the dictionary, the user has the option of adding the destination and its 4 mileage to the dictionary. Then, the destination should be accessible in future loops. The work from class can be found here: https://github.com/rukangu/infoClassWork.git i.e if a user enters 'Nairobi' and it's not in the dictionary, the program should ask them if they would like to add Nairobi to the dictionary of destinations. If they reply with anything else apart from ' y ' or ' Y ', proceed with asking them for another destination. Otherwise, if the user replies with ' Y ' or ' y ', prompt them for the mileage to Nairobi and add Nairobi and the mileage as a key - value pair to the dictionary. Test your code with multiple destinations and confirm that any new destinations that you add are accessible in future iterations of the loop. Where would you like to travel to? Q/q to quit gainesville Destination not available, yet! Add destination? yN n Where would you like to travel next? Qla to quit gainesville Destination not available, yet! Add destination? yNy What's the distance between Athens and Gainesville in miles? 45 Where would you like to travel next? Qlq to quit gainesville Athens to Cainesville costs 4.5s Where would you like to travel next? Q|q to quit Nairobi Destination not available, yet! Add destination? yNy What's the distance between Athens and Nairobi in miles? 8000 Where would you like to travel next? Qlq to quit Nairobi Athens to Nairobi costs 800.0 \$ Where would you like to travel next? Qlq to quit
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
