理解数据类型与数学运算:摄氏温度与华氏温度的相互转换

Python 3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 17:00:18) [MSC v.1900 64 bit (AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> a=input('请输入一个数字')
请输入一个数字25
>>> b=input('请输入另一个数')
请输入另一个数30
>>> sum1=int(a)+int(b)
>>> print('二数之和是:{}'.format(sum1))
二数之和是:55
>>> a=input('请输入摄氏温度')
请输入摄氏温度66
>>> sum1=int(a)*9/5+32
>>> print('华氏温度是:{}'.format(sum1))
华氏温度是:150.8

 

>>> a=input('请输入一个数字')
请输入一个数字25
>>> b=input('请输入另一个数')
请输入另一个数30
>>> sum1=int(a)+int(b)
>>> print('二数之和是:{}'.format(sum1))
二数之和是:55
>>> a=input('请输入摄氏温度')
请输入摄氏温度66
>>> sum1=int(a)*9/5+32
>>> print('华氏温度是:{}'.format(sum1))
华氏温度是:150.8

 

posted @ 2018-04-23 16:46  Harrison520  阅读(251)  评论(0编辑  收藏  举报