#-*-Coding: cp936 -*-
'''
1: Create an empty list
2. Add data elements directly in the list, which can be numbers, strings, and characters.
'''
Mylist = [] #1
Print mylist
Mylist = [1, 'A', 'string']
Print mylist
Mylist = mylist + [2, 'B', 'OK']
Print mylist
Mylist. append ('good ')
Print mylist
Mylist. append (10000)
Print mylist
Mylist. append ('C ')
Print mylist
Mylist. Extend (['x', 1, 'zzz'])
Print mylist
Mylist. insert (0, 'First ')
Print mylist
"""
Retrieve the value count in the list to calculate the number of times an element has been specified in the list. Index returns the subscript of the query element.
"""
Print mylist. Count ('first ')
Print mylist. Index ('first ')
"""
Delete the element del in the list to delete the elements in the list. The remove parameter of the List Index is the list element.
Pop deletes the value of an element from the end.
"""
Del mylist [1]
Print mylist
Mylist. Remove ('good ')
Print mylist
Mylist. Pop ()
Print mylist
"""
Delete the entire list. If no exception is thrown, a list with the same name is created.
"""
Del mylist
Mylist = []
Print mylist
Print