Python 3.X 关键字
来源:互联网 发布:233网校软件下载 编辑:程序博客网 时间:2024/06/01 21:15
在IDLE交互环境下使用如下代码可查看python的关键字:
import keyword
keyword.kwlist
结果会以列表形式显示出来.
以下是版本python 3.6.3的关键字:
['False', 'None', 'True', 'and', 'as', 'assert', 'break', 'class', 'continue', 'def', 'del', 'elif', 'else', 'except', 'finally', 'for', 'from', 'global', 'if', 'import', 'in', 'is', 'lambda', 'nonlocal', 'not', 'or', 'pass', 'raise', 'return', 'try', 'while', 'with', 'yield']
Python的平方根函数内置在math模块中,所以要调用Sqrt()函数必须先import math模块,返回结果为一个浮点型数字
import math
math.sqrt()
>>> math.sqrt(25)
5.0
>>> math.sqrt(80)
8.94427190999916
>>> type(math.sqrt(81))
<class 'float'>
阅读全文
0 0
- Python 3.X 关键字
- python 3.x 关键字 (保留字)
- Python 3.x常见问题
- python 3.x 字符串
- python 3.x 图片下载
- python2.x 3.x的super关键字使用示例
- Python 关键字
- Python:关键字
- python关键字
- python关键字
- python关键字
- python关键字
- python关键字
- python关键字
- Python关键字
- Python关键字
- python的2.x和3.x
- python 3.x 与 2.x区别
- 1.1.2 Mac上面搭建Eclipse+Java+Maven环境
- 微服务架构之分布式事务解决方案一
- JavaScript的内置对象
- Java 笔记 之 类型转换
- PAT 1047. 编程团体赛(20)
- Python 3.X 关键字
- 天嵌TQ_E9卡片电脑移植飞思卡尔yocto L4.1.15_1.0.0_ga 第三篇 新版uboot(2015.04-r0)网卡移植(RTL8211E)
- Microsoft Excel 2010 加载数据分析工具
- Java性能优化注意的几个细节规则
- 错误信息的收集
- Android Studio设置护眼背景色
- ECMA-262-5 词法环境:ECMA实现(一)--- 简介
- Android Studio常用快捷键
- python调用dll例子