I think there is a mistake in the "Thread shed" exercise in the learn python 3 course

See point 22 of this exercise. In particular pay attention to where it says “iterate through thread_sold_split and print a sentence that says how many threads of each color were sold today.”

But I am very certain that is wrong. That’s not what you have to do at all. You don’t iterate through thread_sold_split: you iterate through the list colours like so:

for index in range(len(colours)):
  print("There were {count} {colours} threads sold today".format(count=colour_count(colours[index]), colours=colours[index]))

I hope this is a genuine mistake I have found. All the best, and thank you to whoever wrote this course so far I find it really helpful.

Edit: hopefully I posted this in the right place now.

This was how I interpreted it way back when…

thread_sold_split = []
for row in thread_sold:
  thread_sold_split.extend(row.split('&'))
colors = set(thread_sold_split)
def color_count(color):
  return thread_sold_split.count(color)
for color in colors:
  print ('Color: {} Count: {}'.format(color, color_count(color)))

I think you’re correct–that’s a typo.

b/c in the previous step you create a function called color_count() to total up the sum of each color, and then you iterate through the colors,

colors = ['red','yellow','green','white','black','blue','purple']

for color in colors:
  print(
    "Thread Shed sold {0} of {1} color today."
    .format(color_count(color), color)
  )