1. There is no concept of constants in Python, such as Pi. Typically, the variable name capitalization defaults to constant, but it can still be changed.
2. Python 3.x or later versions of. pyc files are moved to the __pycache__ folder. A program that is executed manually does not generate a. pyc file, which is generated only when it is called by another program.
3. python3.x above version does not have a long length integer type.
4. Python has a del global command that can delete variables, elements, lists, dictionaries, and so on.
5. python3.x above, the list's sort () method can no longer sort the values and strings together.
6. For a discussion of assignments, shades, and slices, see my blog post.
7. The method of numeric value, string, list, tuple, dictionary, please see one of my special blog post.
8. The dictionary's items () method requires a dictionary to be converted to a list, which is inefficient if the amount of data is larger.
Therefore, use the following loops as much as possible:
Adict = {...}
For key in Adict:
Print (Key,adict[key])
Instead of using:
For k,v in Adict.items ():
Print (K,V)
9. The update () method of the dictionary is to update the old dictionary with a new dictionary. If you have the same key in both, the value of the new dictionary overwrites the old dictionary (including the structure). If there is no key, it is added to the old dictionary.
Exit prompt, you can quit the program directly.
Python Learning notes (day2)