Chapter One: Basic knowledge
1. Double slash: The operator that implements the divide
>>>1//2
0
Even if it is a floating-point number, the slash will perform the divide
>>>1.0//2.0
0.0
2. Power (exponentiation) operator: Double star
>>>2**3
8
Tip: You can use the function POW instead of the operator, pow (2,3)
3.16 Binary and octal
Hex: Front plus 0x, first is number 0
>>>0xaf
175
Octal: Add 0o to Python in version 3.0, the first number is 0, the second is the letter O
>>>0o10
8
4. Get user input
With the python3.5.0 version, you need to convert the string operation if you enter a number
>>>x=input ("x:")
X:34
Here the 34 default is the string, if the need is a number, then the conversion operation
>>>x=int (Input ("x:"))
X:34
The value of x here is a number, which can be manipulated
5. Functions
The round function rounds the floating-point number to the nearest integer value
>>>round (1.0/2.0)
Python Learning chapter I (Python Basic Programming second edition)