Thread Shed - Step 8 - simpler code possible? Python 3

Hi there!
I have a questions regarding Step 8 of the Thread Shed exercise in the Python 3 course.

I wrote the code for step 8 as:

transactions_clean = []
for daily in daily_transactions_split:
  for i in range(4):

But the instructor in the video wrote the code as:

transactions_clean = []
for transaction in daily_transaction_split:
  transaction_clean = []
  for data_point in transaction:
    transaction_clean.append(data_point.replace("\n", "").strip(" "))

I believe I got the same result, so I was wondering if my code and thought process is valid, or am I missing something?
Please advice. Thank you!

1 Like