Nov-24-2020, 08:33 AM
Don't
append
it (which adds the list into a single element), extend
it.word_letters = list("python") t = [] t.append(word_letters) print(f"After append, the first element is {t[0]}") t = [] t.extend(word_letters) print(f"After extend, the first element is {t[0]}")
Output:After append, the first element is ['p', 'y', 't', 'h', 'o', 'n']
After extend, the first element is p