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

python语法元素(python3)

2018-01-24 10:49 260 查看
1.注释 #单行
2.命名 大小写字母+数字+下划线 首字母不为数字
3.保留字 and / as / assert / break / class / continue / def / del / elif / else / except / finally / for / from / globall / if / import in is
lambda / nonlocal / not / or / pass / raise / return / try / while / with / yield / True / False / None
4.同步赋值 x,y =y,z
5.逻辑运算符
>>> tom=18
>>> tom>=18
True
>>> tom>18
False
>>> h=160
>>> tom>=18 and h>150
True
>>> tom>18 and h>150
False
>>> tom>18 or h>150
True
>>> not tom>=18
False
>>> tom is h
False

6.输入输出
输入 input()
输出 print()

            
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: