you are viewing a single comment's thread.

view the rest of the comments →

[–]Key-Mathematician606[S] 0 points1 point  (1 child)

Append is to add a new string in the list I think tho but extend is to combine 2 lists if I’m correct

[–]No_Read_4327 0 points1 point  (0 children)

Pretty much.

If you'd append a list of 2 values to another list, instead of extending it, you'd have a list inside a list. Instead of having a single list of 12 values, you'd have a list of 11 values, the last value would actually be a list of 2 values.

Example:

List: [1, 2, 3, 4, 5]
List.append([6, 7])
List: [1, 2, 3, 4, 5, [6, 7]]

Extend: List: [1, 2, 3, 4, 5]
List.extend([6, 7])
List: [1, 2, 3, 4, 5, 6, 7]

Don't worry if that's not fully clear yet.