Thread Shed - color count

In the Thread Shed project i reached step 20 and it turns out the thread count of every color was incredibly off from what should have been printed. I followed the tutorial after to figure out where i went wrong, but everything was correct from what I could tell. Gonna leave my code down below, I’d appreciate help on figuring out where I went wrong.

Start coding below!

daily_sales_replaced = daily_sales.replace(’;,;’ , ‘+’)

daily_transactions = daily_sales_replaced.split(’,’)

daily_transactions_split =

for transaction in daily_transactions:
daily_transactions_split.append(transaction.split("+"))

transactions_clean =

for transaction in daily_transactions_split:
transaction_clean =
for data_point in transaction:
transaction_clean.append(data_point.replace(’\n’,’’).strip(’ '))
transactions_clean.append(transaction_clean)

customers =

sales =

thread_sold =

for transaction in transactions_clean:
customers.append(transaction[0])
sales.append(transaction[1])
thread_sold.append(transaction[2])

#print(customers)
#print(sales)
#print(thread_sold)

total_sales = 0

for sale in sales:
total_sales += float(sale.strip("$"))

#print(total_sales)

#print(thread_sold)

thread_sold_split =

for sale in thread_sold:
for color in sale.split("&"):
thread_sold_split.append(color)

def color_count(color):
color_total = 0
for thread_color in thread_sold_split:
if color == thread_color:
color_total +=1
return color_total

#print(color_count(‘black’))

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

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

You could use a smaller input that you’re able to verify manually, see if that’s still a bad count and if so then you’d want to start making observations of how that bad count was obtained. print is your friend here.

If others are to run (and even read) your code, then you’ll have to ensure that you’re providing an exact copy of it.