Summary of Python basics

1. print() print function , print("abc",end=" ") does not wrap

2. The *n number connection is the multiplication operation, and the string is the number of operations is n

3. input() receives user input

4 , if-elif-else branch structure

5. dir(__builtins__) view BIF, help(BIF) view BIF help

6 , \ escape character

7. str = r'c:\now' gets the original string, you can also do it without escaping

8. Triple-quoted string str='''abc

            fjas

            ljfkla

            '''

  print(str)==" will output in the above format

9 , while loop

10. The random module == "import random ==" randint(1,10) generates a random number of [1,10), the header does not include the tail

11. Scientific notation (e notation)

12、True == 1,False == 0

13, int() / float() / str() type conversion to each other

14. type() to get type information

15. Whether the comparison type of isinstance() is the same, for example: the return value of isinstance('abc', str) is True

16. Operation operator: + - * / % ** //

17. Logical operators: not / and / or

18. Comparison operator: < <= > >= == != 

19. Priority (16-18): exponentiation - sign (unary operator) - arithmetic operator - comparison operator - logical operator (not - and - or)

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326056838&siteId=291194637