python3的基础语法
2017-02-23 11:42
260 查看
python 3.6基础摘要
3.6保留字段
>>> import keyword
>>> keyword.kwlist
['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']
>>>
#encoding = utf-8
#!/usr/bin/python3
#第一个注释
print ("世界和平")
多行语句
total = item_one + \
item_two
python中数有四种类型:整数、长整数、浮点数和复数。
整数, 如 1
长整数 是比较大的整数
浮点数 如 1.23、3E-2
复数 如 1 + 2j、 1.1 + 2.2j
input("\n\n等用户输入")
3.6保留字段
>>> import keyword
>>> keyword.kwlist
['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']
>>>
#encoding = utf-8
#!/usr/bin/python3
#第一个注释
print ("世界和平")
多行语句
total = item_one + \
item_two
total = ['item_one', 'item_two', 'item_three', 'item_four', 'item_five']
数据类型
python中数有四种类型:整数、长整数、浮点数和复数。整数, 如 1
长整数 是比较大的整数
浮点数 如 1.23、3E-2
复数 如 1 + 2j、 1.1 + 2.2j
input("\n\n等用户输入")
相关文章推荐
- Python连载系列之Python语法基础3:Python中的字符串和数据结构
- Python 基础语法(二)
- Python基础语法
- 【python】python语法基础
- Python基础语法学习(字符串)
- Python连载系列之Python语法基础1:开始使用Python
- python 基础教程之语法篇章——一小时入门python__对比python与C语言的语法异同
- Python 基础语法知识(二)
- Python 基础语法知识(一)
- Python语法基础——关于全局变量与局部变量
- Python 基础语法(三)
- python学习日记1--基础语法篇
- learning python of 基础语法
- Python 基础语法知识(三)
- Python2 基础语法(三)
- Python 基础语法(一)
- Python 基础语法知识
- Python2 基础语法(一)
- Python的基础语法
- Python语法基础——关于全局变量与局部变量