PYTHON QUESTION

Laurent Pointal laurent.pointal at free.fr
Sun Jun 14 06:08:24 EDT 2015


adebayo.abraham at gmail.com wrote his student exercise as raw text:

> Help with this problem!
> 
> Temperature converter
> Description
> 
> Write two functions that will convert temperatures back and forth from the
> Celsius and Fahrenheit temperature scales. The formulas for making the
> conversion are as follows:
> 
>   Tc=(5/9)*(Tf-32)
>   Tf=(9/5)*Tc+32
> 
> where Tc is the Celsius temperature and Tf is the Fahrenheit temperature.
> More information and further descriptions of how to do the conversion can
> be found at this NASA Webpage. If you finish this assignment quickly, add
> a function to calculate the wind chill. Input
> 
> Your program should ask the user to input a temperature and then which
> conversion they would like to perform.

One link to help you: http://www.catb.org/esr/faqs/smart-questions.html

You have just to add the Python syntax for functions declaration and return 
value around your expressions (writing let as an exercise)… just care of a 
small difference between Python2 et Python3 with the division operator, 
which may makes you discover a tricky issue with integers manipulation 
(common to many programming languages).

A+




More information about the Python-list mailing list