温度转换(python笔记)
2017-08-22 16:01
417 查看
#温度转换程序 #TempConvert.py val = input("Please input a number") if val[-1] in ['C', 'c']: f = 1.8 * float(val[0:-1]) + 32 print("temperature" % f) elif val[-1] in ['F','f']: c = (float(val[0:-1] - 32) / 1.8 print("temperature" % c) else: print("Error")
33个保留字:
定义变量时,不能与之相同~
name | name | name | name |
---|---|---|---|
and | elif | import | raise |
as | else | in | return |
assert | except | is | try |
break | finally | lambda | while |
class | for | nonlocal | with |
continue | from | not | yield |
def | globall | or | True |
del | if | pass | False |
None |
相关文章推荐
- Python学习笔记 --- 对文本进行编码转换方法1
- Python学习笔记(三)英文字符串的大小写转换
- Python学习笔记 --- 对文本编码进行转换方法2
- python练习-easygui-温度转换2
- python cookbook 学习笔记 -- 1.2 字符与字符值间转换
- python学习笔记11:Access数据库转换为SQLite数据库
- python OpenCV学习笔记(十二):形态转换
- python学习笔记10:Access数据库转换为SQLite数据库之前的准备
- Python语言opencv使用笔记(六)(图像的形态学转换)
- python学习笔记-半角字符和全角之间的转换
- ★★★★[转载]Python学习笔记一:数据类型转换★★★★
- python学习笔记5—数据类型转换
- Python初学笔记--类型转换数值操作
- 树莓派学习笔记——Python SQLite查询历史温度
- python3.4学习笔记(十五) 字符串操作(string替换、删除、截取、复制、连接、比较、查找、包含、大小写转换、分割等)
- Python GUI 温度转换
- Python学习笔记一:数据类型转换
- python tutorial 学习笔记(四) Input and Output, 字符串的转换等
- python 宝典 笔记 第十二章 存储数据和对象 (各种对象转换成字符串)
- Python学习笔记(15)-Python代码转换为exe可执行程序详解