Function Name savvyShopper Parameters fileName str shoppingMethod str Returns

Function Name: savvyShopper() Parameters: fileName (str), shoppingMethod (str) Returns: lowestPrice (tuple) Description: Your friend wants to buy the cheapest costume but does not want to deal with shopping both online and in-person. Write a function that takes in the mode of desired shopping (Online or In-store) and returns a tuple of the cheapest costume available in that mode and its price. Assume there will not be two costumes with the same lowest price. If the mode of shopping or the file name is invalid, return ("", 0). >> savvyShopper("costumeStore1.txt", "Online") ('Willy Wonka', 19.99) >> savvyShopper("costumeStore1.txt", "In-store") ('Thanos', 15.0)

Function Name: savvyShopper()
Parameters: fileName (str), shoppingMethod (str)
Returns: lowestPrice (tuple)
Description: Your friend wants to buy the cheapest costume but does not want to deal with shopping both online and in-person. Write a function that takes in the mode of desired shopping (Online or In-store) and returns a tuple of the cheapest costume available in that mode and its price. Assume there will not be two costumes with the same lowest price. If the mode of shopping or the file name is invalid, return (“”, 0).

>> savvyShopper(“costumeStore1.txt”, “Online”)
(‘Willy Wonka’, 19.99)

>> savvyShopper(“costumeStore1.txt”, “In-store”)
(‘Thanos’, 15.0)


 
Solved By Verified
Study Co-Pilot All Study Co-Pilots are evaluated by Gotit Pro as an expert in their subject area.

 
Instant
Download

Student review: (5 ratings) 5 out of 5 people found this solution helpful.