LEARN PYTHON 3 Thread Shed

Learn Python 3 | Codecademy

Thread Shed

hello, I’m stuck in this exercise. I did exactly what the video did but my output is different

    • Why does my text multiply?
transactions_clean = []

for transaction in daily_transactions_split:
  transaction_clean = []
  for data_point in transaction:
    transaction_clean.append(data_point.strip(" "))
    transactions_clean.append(transaction_clean)
print(transactions_clean)

thanks to whoever helps!!

Double check your indentation on that second .append in you inner for loop. The way you have it written, you’re cleaning, appending, and appending again.

Also, check the forums here for that particular step in that project. They also might be helpful.

4 Likes

Thank you very much for the code explanation!! I wasn’t understanding what the code was doing. I changed the code and fixed the problem.

1 Like