The main contents of this section :
1. Basic Data type supplement
2. Set Set
3. The depth of the cuff?
"". Join method
To iterate through the contents of the list:
of the wrong
Cause: In the For loop, loop to the first, then delete, delete the second element to move forward, the loop pointer backward one bit, and then delete, the result will cause 22,44 not deleted.
only in this way is it possible :
Note: Because deleting an element will cause the element index to change, so delete the element is, try not to delete in the original place, try to create a new and then go to bulk Delete
The Fronkey () in Dict can help us create a dict from the list.
Each of the pre-column tables? Items are treated as key, and the contents of the Post-column table as value. ? into dict
It's all right . Note :
Since the code Jay and JJ use the same list, you should change the
Idea: The elements in the dict are not allowed to be deleted during the iteration, and if you want to delete them, create a new one as well as the same as the previous list Delete method.
Type conversions:
Tuple-->>list list (tuple)
List-->>tuple Tuple (list)
List--->>> string "". Join () method
String--->>> list split cut
0, "", None, [], {}, (), set ()----->>>> can be converted to false
Two, set set
set element is not repeat .. < Span class= "Fontstyle2" > element must be (int, str, tuple,bool)
Note : The elements in the set set must be hash , but the set body is not a hash the. Set is Variable .
Set collection and deletion and modification:
Increase:
. Add () duplicate content is not updated
. Update () Iteration Updates
Delete:
Pop () randomly pops up a
. Remove () to delete the specified content, the error is not present
.clear () emptying set Set . It is important to note that the set print out is set () because to and dict differentiated .
Modify:
The collection does not have an index and cannot be positioned, so the modification can only be deleted in the add
Check: For loop iteration
<<<<<<-----------Other Operations------------>>>>>>>
Three-depth copy:
Shallow copy data unchanged
Deep copy data changes
Younger brother Caishuxueqian, sentiment not too much, oneself feel the depth copy is a bug, have a friend can discuss together.
Python Foundation 07set set of shades and copies