Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

WishList.py 4 # _ a list of strings, representing a list of items on a 5wish lis

ID: 3920468 • Letter: W

Question







WishList.py 4 # _ a list of strings, representing a list of items on a 5wish list 6 -a string, representing a particular item 7a float, representing the cost of this item a float, representing your budget 10|#1 f the item is on the list and you can afford it (cost is 11: #less than or equal to budget), return the 8tring, 12 You should buy a [item name]!", replacing item name] 131?with the string. 14 15: #1f the item is on the list but you can't afford it, 16 #return the string, "You should save up for a [item name]I", 17 replacing [item name] with the string. 18 # 19 #If the item is not on the list, you should return the 20 #3tring "You probably don't want to buy a [item name].", 21-#replacing [item name] with the string. . , 23 HINT: You do not need a loop to solve this. You can use 24 one but you don't need one 25 26 27-Add your function here! 28 29 31?Below are some lines of code that will test your function. 32.#You can change the value of the variable (s) to test your 33 function with different inputs. 34 35 #1f your function works correctly, this will originally 36 "print: "You should save up for a bug lal 37 38 wish list items["bugle, trumpet"."banjo"."tuba"1 39 selected item-"bugle 40 item cost 199.99 41 budget 150.00 42 43 print (wish list (wish list items, selected item, item cost, budget))

Explanation / Answer

def wish_list(items, item, item_cost, budget): if item in items: if item_cost
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote