poguemahon
05-20-2009, 10:37 PM
So, I'm trying to write a pound/kilogram converter, which I will eventually expand into a US Standard to Metric converter, and I don't know how to set the parameters for the equation (I'm trying to make it so that you are asked what conversion you want, you type "pounds" for KG to LB, and it converts the variable you put in).
I've only got as far as this:
print "US Standard/Metric value converter"
print "Would you like to convert to pounds or kilograms?"
pounds="pounds"
kilograms="kilograms"
if "pounds":
#indentation, and the missing part
#indentation else if "kilograms"
I just need to know what I need to use after if "pounds": to multiply it by 0.45359237. I searched the official Python documentation on the site (I'm using an unofficial portable version), and the only thing I've been able to find about calculators was the fact that the interpreter is one.
I've only got as far as this:
print "US Standard/Metric value converter"
print "Would you like to convert to pounds or kilograms?"
pounds="pounds"
kilograms="kilograms"
if "pounds":
#indentation, and the missing part
#indentation else if "kilograms"
I just need to know what I need to use after if "pounds": to multiply it by 0.45359237. I searched the official Python documentation on the site (I'm using an unofficial portable version), and the only thing I've been able to find about calculators was the fact that the interpreter is one.