On 11/28/2010 8:33 PM, Andre Jeyarajan wrote:

Write two functions that will convert temperatures back and forth from the Celsius and Fahrenheit temperature scales (using raw_input)


def C_F(x):

    y = (x-32)*(5.0/9)

print y


def F_C(x):

    y = (x*9.0/5)+32

print y


I have created the two functions but I don’t know what to do from here.


Can you help?


Thanks



_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
I get the curious feeling this is homework. You would need to do one of two things: Pass the output of raw_input as an argument or rewrite your functions so that instead of taking the temperature as a parameter, it asks in the body of the function for a temperature. In either case, you will run into a little TypeError, easily fixed however.
HTH,
~Corey Richardson
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to