The definition of the list of python learning and the addition, deletion and modification

List Definition:

>>> name['lily','lucy','tom']

>>> nums = [11,22,33,'100','lily'] #A list in python can define elements of any type

Use + to add up two lists, or the following method

add and delete

pop is deleted from the back to the front, append is similar to the stack, last in first out

remove() removes the specified element

del arrayname[index] : delete element by index.

Edit :

arrayname[index] = 'new element'

Query: in or not in

 

Guess you like

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