Is it correct? Please explain.
money_spent = 0
for i in prices:
money_spent += prices[i] * quantity[i]
Q: Why can't I use return in this function? What differentiates your solution?
Thanks for reaching out.
You cannot use the return statement in a for loop. You should use the print command. When you use a function you can use both return and print, but return is more appropriate because you can reuse your functions in another functions, which is very useful.
Hope this helps.