add something to the list

Lists can store different types of data, including integers, floating-point numbers, lists, and tuples.

Both append and extend add things to the list, append is to add an element to the end of the list, list1.extend (list2[]) is to combine list 2 into list 1.

list1.insert(position,) inserts an element, either a list or a tuple

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325941701&siteId=291194637