Python Learning
1. List []
1.1) A list is a data structure that handles a set of ordered items, that is, you can store a sequence of items in a list.
1.2) variable data type when listing
1.3) The list consists of a list of [] labels with multiple comma-separated numbers or strings
Example: list[1,2,3] list1['aaa', 123,'qwsx ']
Empty list list[]
Note: When you define a tuple with only one value, add a comma after it, and the list has only one value without adding any symbols
2. Operation of the list
2.1) Re-assignment of the list (in list1["Qaz", "Qwedc"])
list1[0]="aaa" view List1 's ID did not find a change.
2.2) Add a value to the list
List1.append ("123456") eg: adding data by Append method
2.3) Delete a value from the list:
List1.remove (list1[3]) or list1.remove["123456"] The latter removes the first occurrence of the value
Delete entire list: Del (list1[])
2.4) Helpful: Help (list.)
3. Quick start for objects and classes
3.1 Object = attribute + method
A list is a class, and the list1 we define ourselves is an object of the list. This object has append, Del,remove and other methods.
Python Learning---data type---list