Home >Backend Development >Python Tutorial >What knowledge do you need to master to learn the basics of Python?
1.1 Python objects
Python has many built-in object types, including numbers, strings, lists, sets, tuples, dictionaries, etc. In Python, everything is an object
pickle--In Python, if there are some objects that need to be stored persistently without losing the type and data of the object, the data needs to be serialized. After serialization, when it needs to be used, it will be restored to the original data. The serialization process becomes pickle
One of the built-in data types of Python is a list: list.
list is an ordered collection.
A list consists of a series of elements arranged in a specific order. Represented by [ ]. The data types of the elements in the
list can also be different, for example:
##>>> L = ['Apple', 123, True] |
insert() Specify the index and value of the new element.
>>> classmates ['Michael', 'Jack', 'Bob', 'Tracy', 'Adam'] |
position del ABC[0]1.2. To delete the element at the end of the list, use the pop() method.
1.3. To delete the element at the specified position, use the pop(i) method, where i is the index position.
1.4. Use the pop() method to delete elements (pop), and then use the delete value.
1.5. Delete elements according to
valueremove()2.2.4 Modify elements
>>> len(s) 4 |
The above is the detailed content of What knowledge do you need to master to learn the basics of Python?. For more information, please follow other related articles on the PHP Chinese website!