1.python Introduction
Python is an interpreted language that code wants to run and must be executed by the interpreter
Interpreter types are CPython, IPython, PyPy, Jython, IronPython, etc.
2. Variables
declaring variables
name=‘Crab’
Variable definition rules
- Variable names can only be any combination of letters, numbers, or underscores
- The first character of a variable name cannot be a number
- Keyword cannot be declared as a variable name
Variable naming habits
驼峰体AgeOfOldboy=22下划线age_of_oldboy=22
Define the low mode of a variable
变量名为中文、拼音变量名过长变量名词不达意
3. Constants
Constants are constant quantities, such as Pai 2.1415 ....
Python does not have a specific syntax to represent constants, which are used to represent constants with all uppercase names in the variable name.
AGE_OF_OLDBOY=22
4. Read user input
name=input(‘what is your name ?‘)print(‘hello‘ + name)
5. Notes
Code comments with #
6. Data type
In Python, the quoted characters are considered to be strings!
Boolean two values, a true (true), a false (false), mainly used for logical judgment!
7. Operators
Python Training Camp Study: Chapter I python basics