Chapter 1 Rapid Retrofit: The Basics
1. Algorithm: A detailed description of how to do something .
2. Real numbers (numbers containing a decimal point ) are called floating point numbers in python.
3. Division: The double slash '//' means the whole division, after the division is performed, the integer part is obtained ; the percent sign '%' means the remainder is taken, after the division is performed, the remainder part is obtained ; if you want to perform ordinary division, it is best to add decimal point .
4. Power operator: It is two multiplication signs '**'.
5. A long integer is an integer followed by the letter L , which can be mixed with ordinary integers .
6. Octal number: the first digit is 0
7. Hexadecimal numbers: start with the number 0 and the letter x
8. A variable is an object to which a value is bound . A variable is basically a reference to a value by name. (eg x = 3, x is bound to the value 3)
9. Expression: to express something .
10. Statement: To do something.
11.input() Get user input. Only expressions can be entered.
12.raw_input() Get user input, both real numbers and strings.
13. Values are not actually stored in variables - they are stored deep in the computer 's memory , referenced by variables .
14.pow(x,y) Power function.
15.abs(number) can get the absolute value of real numbers .
16.round(x) can round up floating point numbers .
17. In the math module, math.floor(x) rounds down .
18. In the math module, math.ceil(x) rounds up .
19. In the math module, math.sqrt(X) means taking the square root .
20.foo = math.sqrt Variables can also be bound to functions.
21. The role of the backslash '\' is to escape .
22. Long strings: represented by three quotation marks .
23. Original string: Start with the letter r , the function is to ignore the effect of the backslash, note that the original string cannot end with a backslash.
24. Unicode strings: start with the letter u .