When I am trying to run the code I get answer as zero. What is wrong with my code ?
for i in prices:
if prices[i]<5:
money_spent =+ prices[i] * quantity[i]
else:
money_spent = money_spent
print (money_spent)
1 answers ( 0 marked as helpful)
Hi Taufiq!
Thanks for reaching out.
To assist you better, we would probably need more information. Nevertheless, I suppose that you may have missed executing the previous code cells from your Jupyter Notebook Document. In other words, please double-check if you've managed to successfully assign values to the prices
and quantity
objects.
Hope this helps but please feel free to get back to us should you need further assistance. Thank you.
Best,
Martin