Last answered:

07 Dec 2021

Posted on:

18 Nov 2021

1

H.W

prices = {
    "box_of_spaghetti" : 4,
    "lasagna"  : 5,
    "hamburger" : 2
   }
quantity = {
    "box_of_spaghetti" : 6,
    "lasagna"  : 10,
    "hamburger" : 0
    }

money_spent = 0
money5=0
moneyl5=0
for i in prices:
    money_spent = money_spent + (prices[i]*quantity[i])
    if prices[i]== 5:
         money5=money5+prices[i]*quantity[i]
    elif prices[i]<5:
        moneyl5=moneyl5+prices[i]*quantity[i]
print("money for 5 :",money5)
print("money less t5 :",moneyl5)
print("total money spent:",money_spent)

1 answers ( 0 marked as helpful)
Instructor
Posted on:

07 Dec 2021

1

Hi Mahmoud!

Thanks for reaching out!

Could you  please specify what exactly the question is? Thank you.

Looking forward to your answer.
Best,
Martin

Submit an answer