Hello.
I am a n00b learning to code in Python. Right now, I am working on functions and parameters. To practice, I am making a simple Celsius-to-Farenheit converter. However,whenever I run the program it returns a NameError. I am confused in my n00bishness.
Please reply.
Here is my code:
>>> def get_celsius(celsius):
celsius=input("Type in the Celsius temperature:" )
return celsius
>>> def main():
get_celsius(celsius)
farenheit=(9.0/5.0)*celsius+32
print "It is",farenheit,"degrees outside."
Here is my error:
Traceback (most recent call last):
File "<pyshell#11>", line 1, in <module>
main()
File "<pyshell#10>", line 2, in main
get_celsius(celsius)
NameError: global name 'celsius' is not defined