Python导入模块
使用import
1 2 3 4
| import math
print(math.pi) print(math.sin(math.pi))
|
使用from
1 2 3 4 5
| from math import pi,sin,cos
print(pi) print(sin(123)) print(cos(123))
|
定义别名
1 2 3 4 5
| from math import sin as mysin from math import cos as mycos
print(mysin(123)) print(mycos(123))
|
处无为之事,行不言之教;作而弗始,生而弗有,为而弗恃,功成不居!
微信支付
支付宝