New to python, baffled by program output

Lazareth S. Link Lazareth at
Thu Sep 30 21:15:24 CEST 2004

Hiya to whoever might stumble across this.

I've recently taken up learning how to script/program in python.
I've made my first program, a simple fahrenheit-celsius converter,
both ways.
For some reason I fail to comprehend, the program writes a line of
"None" when rerun in a while loop.
Here is the code:

def choice_c():
	celsius = input("Input celsius: ")
	print "Fahrenheit: ",cel_fah(celsius)

def choice_f():
	fahrenheit = input("Input fahrenheit: ")
	print "Celsius: ",fah_cel(fahrenheit)

def cel_fah(placeholder):
	return 9.0/5.0*placeholder+32

def fah_cel(placeholder):
	return (placeholder-32.0)*5.0/9.0

def options():
	print "press 'c' to convert celsius to fahrenheit."
	print "press 'f' to convert fahrenheit to celsius."
	print "press 'q' to exit program."

choice = "n"
while choice != "q":
	choice = raw_input("Choice: ")
	if choice == "c":
	elif choice == "f":
	print options()

Any of you know why it prints that line? Is is just my comp?
If any applies, how to get around it?
Would greatly appreciate the help.

More information about the Python-list mailing list