Hello there, long story short, I’m just badly stuck (wanna rip my hair off) on the “thread shed” project, here in codeacademy.com… I have tried to find an answer/explanation/fix across the forums, and there was even a thread with the same problem that I was having, but their ending was just to blame the system itself…So I really would appreciate all the help I could get…!
I’m stuck on the step 20 (Test your new function by running
color_count('white') . It should return 28)
But it returns 112 for me, checking with other colors I have noticed that it ALWAYS returns a number that’s exactly 4 times bigger than the one that i was supposed to be getting (I mean, sure I could just divide by 4, but I kinda want to know where did I go wrong in the code itself x.x)
def color_count(color): ats = 0 for i in thread_sold_split: if color == i: ats += 1 return ats daily_sales_replaced = daily_sales.replace(";,;", "___") daily_transactions = daily_sales_replaced.split(',') daily_transactions_split =  transactions_clean =  for i in daily_transactions: daily_transactions_split.append(i.split("___")) for i in daily_transactions_split: transaction_clean =  for data_type in i: transaction_clean.append(data_type.strip()) transactions_clean.append(transaction_clean) thread_sold_split =  customers =  sales =  thread_sold =  total_sales = 0 for i in transactions_clean: customers.append(i) sales.append(i) thread_sold.append(i) for i in sales: total_sales += float(i.strip("$")) for i in thread_sold: for letters in i: splat =  if letters == "&": splat = i.split("&") for u in splat: thread_sold_split.append(u) break if splat == : thread_sold_split.append(i) print(color_count('green'))
Edit: Found the mistake finally… “transactions_clean.append(transaction_clean)” had to be on the first loop not the second one (aka I just spent like 2 hours stuck on this code cause of a single space button, most definitely “not” discouraged at all, bruh)