您的位置:首页 > 编程语言 > Python开发

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

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等用户输入")
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  python3