Trimming the list, add, delete, change,

a=["a","b","c","d"]

increase:

append ( "e") added at the end

a.insert (2, "e") behind the increase in the third print (abced)

change:

a[1]=aa print(a aa c d)

a[0:2]=[aa,bb] print(aa bb c d)

delete

remove ( "a") Deletes the specified character

a.pop (2) delete the specified character position

Guess you like

Origin www.cnblogs.com/penn666/p/12093796.html