1my_list = [23, 11, 42, 24523]
2
3# append will add it as if you're adding a new list to it
4my_list.append([34523, 76979])
5print(my_list)
6
7# extend will go over each item in the new source list and add each
8# element as part of the target list (my_list)
9my_list.extend([12, 99])
10print(my_list)
11
12"""
13Output:
14[23, 11, 42, 24523, [34523, 76979]]
15[23, 11, 42, 24523, [34523, 76979], 12, 99]
16"""
1my_list = [23, 11, 42, 24523]
2
3# append will add it as if you're adding a new list to it
4my_list.append([34523, 76979])
5print(my_list)
6
7# extend will go over each item in the new source list and add each
8# element as part of the target list (my_list)
9my_list.extend([12, 99])
10print(my_list)
1The extend() method adds the specified list elements (or any iterable) to the end of the current list.