What are the commonly used lists in Python?
This article mainly explains "what is the commonly used list of Python". The content of the explanation is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "what is the commonly used list of Python".
1. Multidimensional list
List, from a conventional point of view, there are many dimensions, different dimensions in different aspects can play a more intuitive effect, can help our business logical thinking.
In general, our commonly used lists are one-dimensional list, two-dimensional list, and three-dimensional list.
1. One-dimensional list:
List1= ["110001", "Liu Jinyu", "male", "60"]
List2= ["110002", "Ruhua", "female", "70"]
List3= ["110003", "programming", "female", "30"]
List4= ["110004", "Creative", "male", "20"]
2. 2D list:
ListA= [list1,list2]
ListB= [list3,list4]
3. 3D list:
ListC= [listA,listB]
II. Supplement of other knowledge
a. Get the list length len function
Len (list) returns the length of the list. Note that this function returns the length of the first layer.
b. Batch comment
1. Select the code
2. Press the shortcut key ctrl+/
c. The index of the array
The index start value of the array is 0, counting from 0
III. Summary and emphasis
1. Master for nesting
2. While nesting
3. Mixed use of while and for
4. Master one-dimensional array, two-dimensional array and three-dimensional array
Thank you for your reading, the above is the content of "what is the commonly used list of Python?" after the study of this article, I believe you have a deeper understanding of what the commonly used list of Python has, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!