Thread Shed Project: Why does this code work when using an empty list and not a variable?

for tran in daily_transactions_split:
  boop = []
  for ting in tran:
    boop.append(ting.replace("\n", "").strip(" "))

Hello @h1lo, welcome to the forums! The empty list is still a variable. The reason you reset it to [] for every

iteration is that you are using it as a means to collect certain information, and append that to something else as a single item. If you didn’t reset it, you would get the same things appended to transactions_clean time after time.