Python: Nested Loops Lesson Fourth Step

I have done everything correct. The fourth step says to " Print out the value of scoops_sold outside of the nested loop." When I print it gives me the proper value but says there’s an error and my print statement might be indented. I can assure you it is not (code below). I’m a little stuck and not sure if I should add on to the nested loop. Did I miss something?

Screenshot (289)

Your code looks fine.
You might want to try deleting and re-adding the indenting for lines 5 and 6. Sometimes it gets confused, especially if there’s a mix of spaces and tabs.

Hope that helps

you removed the previous print of location

sales_data = [[12, 17, 22], [2, 10, 3], [5, 12, 13]]
scoops_sold =0
for location in sales_data:
  for item in location:
    scoops_sold += item

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.