Do I need to write another for loop to print and calculate the total?


#1

Question

Do I need to write another for loop to print and calculate the total?

Answer

This step can actually be done either way! If you want to print and calculate the total inside of the loop you’ve already made, that works (assuming you do it correctly). If you want to make a new loop and keep it all separate, that works as well!


FAQ: Learn Python: A Day at the Supermarket - Something of Value
#2

2 posts were split to a new topic: Calculating Total Within a Loop


#3

2 posts were split to a new topic: Loop Prints 117 as “Total”, But Not Getting Passed