Understanding Data Types and Math: Converting Celsius to Fahrenheit

>>> n1=input( ' Please enter the first number: ' )
Please enter the first number: 6 
>>> n2=input( ' Please enter the second number: ' )
Please enter the second number: 9 
>>> sum2= int (n1)+ int (n2)
 >>> print( ' The sum of the two numbers is: {} ' .format(sum2))
The sum of the two numbers is: 15

 

>>> f=input( ' Please enter the temperature in Fahrenheit: ' )
Please enter the temperature in Fahrenheit: 90 
>>> c= 5 / 9 *( float (f)- 32 )
 >>> print( ' {}The conversion from Fahrenheit to Celsius is: {} ' .format(f,c))
The conversion of 90 Fahrenheit to Celsius is: 32.22222222222222

 

Guess you like

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