發現Python都忘得差不多了,簡單複習一下。
Install
- anaconda
- conda
Input
help(input)
name = input('what is your name? ')
Modules and Imports
Can use dir() to check the namespace difference.
import math
import math as fun
from math import pi, tan
from math import pi as pie, tan as tangent
Data Type
- int
- float
- bool
Basic Math Functions
math
pi
e
isinf
isnan
factorial
log
exp
pow
sqrt
cos
acos
degrees
radians
acosh
asinh
Sequence Types
- str
- byte
- bytearray
- list
- tuple
- slicing
slice[start, stop, step]
Collection & Mapping
- range
- set
- dict
Loops & Conditions
- while
- for
- if