Help with python functions?
Roy Smith
roy at panix.com
Mon Sep 23 09:11:25 EDT 2013
In article <e484b709-1287-4e6a-bc43-05f02a608579 at googlegroups.com>,
kjakupak at gmail.com wrote:
> 1.a. Write a function temp(T, from_unit, to_unit) where from_unit and to_unit
> are temperature units, either 'F' (or 'f') for fahrenheit, or 'C' (or 'c')
> for celsius, or 'K' (or 'k') for kelvin; and T is a temperature number for
> the unit from_unit. The function should return the temperature number in the
> unit to to_unit; no unit is returned. [input(...) and print(...) are not
> allowed]
We don't do people's homework for them.
But, I'll give you a hint. Forget about doing this in python. Write
down the steps you would take to do this problem with pencil and paper.
That really is how you begin any programming problem; understanding the
algorithm you need to execute. The rest is, as Mozart said, just
scribbling.
More information about the Python-list
mailing list