The exam is coming soon, and I believe everyone has already reviewed the big knowledge blocks. Today, let's take a look at some of the more detailed knowledge points! ! !
- abs() is used to calculate the modulus length of complex numbers
- Python does not support the addition of characters and numbers
>>> 'a'+1
Traceback (most recent call last):
File "<pyshell#4>", line 1, in <module>
'a'+1
TypeError: can only concatenate str (not "int") to str
- Then look at ------》
>>> 2**2**3
256
>>> #从右往左计算
- Logical operation
and: return the first false value
from left to right or: return the first true value from left to right, and return the last value if it doesn’t match - ord() returns Unicode code
- chr() returns the corresponding character
>>> isinstance(3,str) False
Determine the data type- input() data type is string
Range () function review The interval of left closed and right open
range(5) ------>范围是 0 1 2 3 4
range(1,5)------> 范围是 1 2 3 4
Welcome to follow my official account, learn together and make progress together.