- Find Ticket Function Name Findticket Parameters Ticketdictionary Dict Returns Cheapest Ticket Tuple Descript 1 (105.47 KiB) Viewed 12 times
Find Ticket Function Name: findTicket() Parameters: ticketDictionary (dict ) Returns: cheapest Ticket ( tuple ) Descript
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
Find Ticket Function Name: findTicket() Parameters: ticketDictionary (dict ) Returns: cheapest Ticket ( tuple ) Descript
Find Ticket Function Name: findTicket() Parameters: ticketDictionary (dict ) Returns: cheapest Ticket ( tuple ) Description: You and your Georgia Tech friends decided to see the Winter Olympic Games in Beijing, China. You want to find the cheapest airplane ticket for your trip. Given a ticket dictionary with names of airlines (str) as keys and prices (int) as values, write a function that returns a tu- ple with the name and price of the cheapest available option. If the ticket dictionary does not have any airline-price pairs, you should return "No tickets available!" Note: No two flights will have the same ticket price, and no plane ticket price will exceed $10,000. >>> ticketDictionary = { "Air Canada": 722, "Alaska" 931, "jetBlue": 871 } >>> findTicket (ticket Dictionary) ('Air Canada', 722)