python 导入模块及函数使用
2018-03-17 18:42
465 查看
import math # 导入 math 模块,如果要同时导入多个模块,只需要在模块名之间用逗号进行分隔 for eachNum in range(3): print(round(math.pi, eachNum)) # 四舍五入 3.0 3.1 3.14 print(math.pow(3,3)) # 27.0 def addMe2Me(x): # def 定义函数 return x + x print(addMe2Me(4)) # 8 print(addMe2Me("str")) # strstr
相关文章推荐
- python导入模块,使用模块内函数,os,os.path
- python 使用 signal模块实现函数调用超时问题
- python中使用sys模板和logging模块获取行号和函数名的方法
- python 关于自定义 模块(类,函数),包的导入
- Python模块及函数的使用
- python中使用sys模板和logging模块获取行号和函数名的方法
- Python模块在使用中的两种导入方法
- python 模块的导入和使用
- Python使用xlrd模块操作Excel数据导入的方法
- Python使用xlrd模块操作Excel数据导入的方法
- 使用Python内置的模块与函数进行不同进制的数的转换
- 使用Python内置的模块与函数进行不同进制的数的转换
- [转]可爱的 Python:: 使用 itertools 模块中的组合函数
- Python使用xlrd模块操作Excel数据导入的方法
- Python的模块module导入与使用
- Python:使用threading模块实现多线程编程三[threading.Thread类的重要函数]
- Python模块及函数的使用
- python笔记-re模块的几个函数使用
- Python函数模块创建、发布和使用
- Python:使用threading模块实现多线程编程三[threading.Thread类的重要函数]