python学习笔记注意要点
2016-06-07 23:24
483 查看
1、条件语句格式
num = input('Enter a number: ')
if num > 0:
print('The number is positive')
elif num < 0:
print('The number is negative')
else:
print('The number is zero')
注意要点:在条件的后面记得添加冒号
num = input('Enter a number: ')
if num > 0:
print('The number is positive')
elif num < 0:
print('The number is negative')
else:
print('The number is zero')
注意要点:在条件的后面记得添加冒号
相关文章推荐
- Java\Scala\Python三种语言求解经典编程实例(四)—— 求10000以内的自守数
- Python中使用__slots__注意项
- Python学习笔记 —— 字符串及常用函数
- python 正则表达式对转义符的处理
- python函数
- python声明源文件编码格式、选择解释器
- Java\Scala\Python三种语言求解经典编程实例(三)—— 不重复的3位数
- Python 序列中的易错点
- python-day0003-搭建基于python的selenium自动化测试---元素定位
- leetcode 114. Flatten Binary Tree to Linked List-二叉树变链表|指针
- python
- Python日志模块logging
- Python基础之运算操作符总结
- 欢迎使用CSDN-markdown编辑器
- Win7 Python2.7 安装教程
- Python 格式化输出 —— %r 与 %s 的区别(__repr__ 与 __str__)
- Python(2)-第二天
- Python(1)-第一天
- Python 装饰器 学习笔记
- 实战 virtualenv 搭建多版本 Python 环境