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()
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()
相关文章推荐
- python语法元素
- Python学习笔记·Python语法元素
- Python语法元素入门
- Python语法元素入门
- python - 语法元素 - for in
- Python语法元素分析
- PYTHON中的语法元素(续)--Python(8)
- Python语法元素分析
- Python基本语法元素
- python语法元素分析
- python - 语法元素 - 列表推导式
- Python基础语法
- Python 基础元素
- Python3 Tkinter基础 Listbox for循环与insert 将一个列表中元素添加到Listbox中
- SVC中语法元素adaptive_base_mode_flag的含义
- Python中的with…as…语法
- Python学习之路-简单语法
- python_装饰器_语法糖
- python 注意的语法
- [Python基础]005.语法(4)