Thread Shed Step 8 Repititons

Please help, this is driving me up the wall! I have watched the video walk-through and have applied the code the same but I get 4 print versions, I can see others have had the same issue but I can’t see any responses that clarify what is going on to cause this. Does it affect the rest of the project or is it just a side-affect of the print function due to the iterations in the loop? The previous step only prints one of each item.

My code is below:

daily_sales_replaced = daily_sales.replace(“;,;”, “~” )
#print(daily_sales_replaced) success!
daily_transactions = daily_sales_replaced.split(“,”)
#print(daily_transactions) worked but lots of \n
daily_transactions_split =
for item in daily_transactions:
#print(daily_transactions_split) #split with lots of whitespace.
transactions_clean =
for transaction in daily_transactions_split:
transaction_clean =
for data_point in transaction:
transaction_clean.append(data_point.replace(“\n”, “”).strip(" "))

print(transactions_clean) #why does this print 4 iterations of each one?!?!


Line 124 needs to be outdented to line up with the outer loop and not be inside the inner loop.

1 Like

Thanks problem solved! :smile:

1 Like