Python Study Notes 2-column (list)

Source: Internet
Author: User

Column, similar to the concept of array, but a higher level of data structure, each element attribute can be different, directly onCodeRight.

#! /Usr/bin/Pythona = ['egg', 'apple ', 100,200] print aprint A [0] print a [] # modifya [2] = A [2] + 10 print a [2] # replacea [] = ['pig', 'Dog'] print a # removea [] = [] print a # inserta [] = ['Tom ', 'jack'] print aprint Len ()

Corresponding output:

['Egg', 'apple', 100,200] Egg ['apple', 100] 110 # modify ['pig', 'Dog', 'apple ', 110,200] # Replace ['apple', 110,200] # Remove ['apple', 'Tom ', 'jack', 110,200] # insert5 # Len
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

Tags Index: