Python is an interpreted language
2018.2.2 Assignment of variables
Naming rules for variables
Official suggested underline
Constant
Variable name uppercase is a constant, you should not overwrite
Practice variables:
2018.2.4
Character encoding and Binary
Unicode Unified Code, Universal code
can print multiple lines,msg= comments,print msg
User input
The first method: (Don't use, forget)
The second method:
the problem that occurs when age is entered is the str type
Workaround:
The third method:
Password
If-else Judgment Statement
Practice
While Loop
For Loop
and the Java is similar, write a three each
Practice guess any game
Continue: Jump out of this loop and continue to the next loop
Break: End the entire loop
for I in range (0,10):
if i<5:
Print ("loop", i)
Else:
Continue
Print ("hehe ...")
For loop inline loop
2018.3.1
Module Initial Knowledge
Standard libraries and third-party libraries
General Standard Library put in Lib , third party put in site_package
Sys Library
Os Library
Problems that arise
Import Login
by default in the current directory to find, when login.py placed under the new_dir ,import will not find
Workaround:
- Place in a third-party library Sitepackage(too simple to use)
- Add path, speak later
What is PYC?
There's PYC under C:\Users\lenovo\AppData\Local\Programs\Python\Python36\Lib\site-packages\__pycache__. file
data types and data operations, similar to Java
Ternary operations
Binary conversion
binary to System : take four in Unity
2 binary , one point four
Byte Type
Learn the Python video notes from Golden Horn King.
Python Basic Learning day1