After my last Email received I have been able to successfully create a
Converter, currently it only has 6 units, but I will be adding more. My current
code is
# Converter
Unit_Menu="""
1) Centimeters
2) Inches
3) Feet
4) Yards
5) Miles
6) Millimeter
Select a unit(1-6) """
>From = raw_input(Unit_Menu)
To = raw_input(Unit_Menu)
Variable = int(raw_input("Insert Amount to Convert "))
And then of course I have multiple followings after this, one example of is
this.
# Centimeters to Inches
if From == "1" and To == "2":
if Variable < 2:
print Variable, "Centimeter is", Variable/2.5, "Inches"
else:
print Variable, "Centimeters is", Variable/2.5, "Inches"
It works perfectly, so I am sure my question will not be hard to answer.
When Python gives me the answer to my conversion, is there a way to create it
so every 3 numbers a comma is inserted?
Such as: 1 mile is 5,280 feet. Instead of 1 mile is 5280 feet. Yes a simple
thing, but something which I believe will make it look better.
Also is there a way to make this so I don't have to go through every individual
line of code and add *insert comma* or something to it, simply at the top like
how the Unit Menu is placed only once there, and yet applies to the whole
document. Thank you
_______________________________________________
Tutor maillist - [email protected]
http://mail.python.org/mailman/listinfo/tutor