Understand data types and math operations: summation, temperature conversion

>>> a=input( ' Please enter a number ' )
Please enter a number 5
>>> print(a)
5
>>> type(a)
<class 'str'>
>>> int(a)+6
11
a=input( ' Please enter a temperature in Celsius ' )
sum2 =int(a)*9/5+32
 print ( ' The converted Fahrenheit temperature is: {} ' .format(sum2))

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324653390&siteId=291194637