No import and no dictionary 1. Mee Mee and Lee Lee have come to visit Dee Dee and she remembers that there are cookies,

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

No import and no dictionary 1. Mee Mee and Lee Lee have come to visit Dee Dee and she remembers that there are cookies,

Post by answerhappygod »

No import and no dictionary
1. Mee Mee and Lee Lee have come to visitDee Dee and she remembers that there are cookies, muffins andsweets, so she takes three plates and puts the same amount of eachdessert on each plate and what is left on a table. In case there isnot enough of any dessert (<3), Dee Dee puts that dessert on thetable and nothing on each plate.
def dessert_distribution(qty_c, qty_m,qty_s):
Description: Given the quantity of cookies(qty_c), muffins (qty_m) and sweets (qty_s), return how they wouldbe distributed on each plate and on the table.
Parameters: quantity of cookies (qty_c),muffins (qty_m) and sweets (qty_s). Each integer. Assume qty_c,qty_m, qty_s are >=1 and <=7
Return value: How the desserts would bedistributed on each plate and on the table (string). Use a tab toseparate each distribution. If a dessert is not placed on a plateor on the table, do not print any character for it.
Examples: dessert_distribution(2,4,7) β†’ '🧁🍬🍬 πŸͺπŸͺ🧁🍬'
dessert_distribution(3,6,3) β†’ 'πŸͺ🧁🧁🍬 '
dessert_distribution(1,2,1) β†’ ' πŸͺ🧁🧁🍬'
No Import And No Dictionary 1 Mee Mee And Lee Lee Have Come To Visit Dee Dee And She Remembers That There Are Cookies 1
No Import And No Dictionary 1 Mee Mee And Lee Lee Have Come To Visit Dee Dee And She Remembers That There Are Cookies 1 (54.09 KiB) Viewed 7 times
2. Mandak has heard about Dexter's newexperiment and decides to buy what he needs to try to finish itfirst. On a list, he writes down (in order of priority) the itemshe must buy. He wants to know how many items can purchase with thecash he currently has.
def how_many_items(items, cash):
Description: Given a list of items andcash, return how many items can be purchase.
Parameters: items (list of strings), cash(float).
Assume The length of the list is >=1 and <=10
An item can be more than once in the list.
Return value: how many items can bepurchase (int), based on the items list and these prices:
Examples:
how_many_items(["hammer","screws","box nails"],33.57) β†’ 3
how_many_items(["batteries","screws"],5) β†’ 0
how_many_items(["screws","screws","screws"],1.76) β†’ 2
Examples: dessert_distribution dessert_distribution dessert_distribution (2,4,7) β†’ (3,6,3) β†’ (1,2,1) β†’
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply