理解数据类型与数学运算:求和、温度转换

>>> a=input('请输入一个数')
请输入一个数5
>>> print(a)
5
>>> type(a)
<class 'str'>
>>> int(a)+6
11
a=input('请输入一个摄氏温度')
sum2=int(a)*9/5+32
print('转换的华氏温度是:{}'.format(sum2))

猜你喜欢

转载自www.cnblogs.com/gfhbrhtr/p/8877823.html
今日推荐