def Calculations():
print()
print("Here are your options:")
print("A. Addition")
print("B. Subtraction")
print("C. Multiplication")
print("D. Division")
print("E. Modulus")
print("F. Exponent")
print("G. Square")
print("H. Square Root")
print("I. Cube")
print("J. Cube Root")
print()
sub1choice = input("Which one would you like to choose, A, B, C, D, E, F, G, H, I, or J? ")
sub1choice = sub1choice.upper()
if sub1choice == "A":
addition()
yn = input("Do you wish to perform more operations in the calculations section (enter 'Y' for yes and 'N' for no)? ")
yn = yn = yn.upper()
if yn == "Y":
Calculations()
elif yn == "N":
Main_Menu()
elif sub1choice == "B":
subtraction()
yn = input("Do you wish to perform more operations in the calculations section (enter 'Y' for yes and 'N' for no)? ")
yn = yn = yn.upper()
if yn == "Y":
Calculations()
elif yn == "N":
Main_Menu()
elif sub1choice == "C":
multiplication()
yn = input("Do you wish to perform more operations in the calculations section (enter 'Y' for yes and 'N' for no)? ")
yn = yn = yn.upper()
if yn == "Y":
Calculations()
elif yn == "N":
Main_Menu()
elif sub1choice == "D":
division()
yn = input("Do you wish to perform more operations in the calculations section (enter 'Y' for yes and 'N' for no)? ")
yn = yn = yn.upper()
if yn == "Y":
Calculations()
elif yn == "N":
Main_Menu()
elif sub1choice == "E":
modulus()
yn = input("Do you wish to perform more operations in the calculations section (enter 'Y' for yes and 'N' for no)? ")
yn = yn = yn.upper()
if yn == "Y":
Calculations()
elif yn == "N":
Main_Menu()
elif sub1choice == "F":
exponent()
yn = input("Do you wish to perform more operations in the calculations section (enter 'Y' for yes and 'N' for no)? ")
yn = yn = yn.upper()
if yn == "Y":
Calculations()
elif yn == "N":
Main_Menu()
elif sub1choice == "G":
square()
yn = input("Do you wish to perform more operations in the calculations section (enter 'Y' for yes and 'N' for no)? ")
yn = yn = yn.upper()
if yn == "Y":
Calculations()
elif yn == "N":
Main_Menu()
elif sub1choice == "H":
square_root()
yn = input("Do you wish to perform more operations in the calculations section (enter 'Y' for yes and 'N' for no)? ")
yn = yn = yn.upper()
if yn == "Y":
Calculations()
elif yn == "N":
Main_Menu()
elif sub1choice == "I":
cube()
yn = input("Do you wish to perform more operations in the calculations section (enter 'Y' for yes and 'N' for no)? ")
yn = yn = yn.upper()
if yn == "Y":
Calculations()
elif yn == "N":
Main_Menu()
elif sub1choice == "J":
cube_root()
yn = input("Do you wish to perform more operations in the calculations section (enter 'Y' for yes and 'N' for no)? ")
yn = yn = yn.upper()
if yn == "Y":
Calculations()
elif yn == "N":
Main_Menu()
elif sub1choice == "X":
Main_Menu()
else:
print("Please enter a valid option!")
Calculations()
def addition():
print()
print("Please enter your numbers to add together (enter '=' when finished entering)")
print()
num = 0
addlist = []
while not num == "=":
num = input("Please enter a number to add: ")
if num == "=":
s = sum(addlist)
print("The sum of all your numbers is " + str(s))
break
num = float(num)
addlist.append(num)
def subtraction():
print()
print("Please enter your numbers to subtract from each other (enter '=' when finished entering)")
print()
num = 0
sublist = []
while not num == "=":
num = input("Please enter a number to subtract: ")
if num == "=":
d = sublist[0]
for i in range(1, len(sublist)):
d -= sublist[i]
print("The difference of all your numbers is " + str(d) + ".")
break
num = float(num)
sublist.append(num)
def multiplication():
print()
print("Please enter your numbers to multiply (enter '=' when finished entering)")
print()
num = 0
mullist = []
while not num == "=":
num = input("Please enter a number to multiply: ")
if num == "=":
p = mullist[0]
for i in range(1, len(mullist)):
p *= mullist[i]
print("The product of all your numbers is " + str(p) + ".")
break
num = float(num)
mullist.append(num)
def division():
print()
print("Please enter your numbers to divide by (enter '=' when finished entering)")
print()
num = 0
divlist = []
while not num == "=":
num = input("Please enter a number to add: ")
if num == "=":
q = divlist[0]
for i in range(1, len(divlist)):
q /= divlist[i]
print("The quotient of all your numbers is " + str(q) + ".")
break
num = float(num)
divlist.append(num)
def exponent():
print()
b = input("Please enter the base: ")
b = float(b)
e = input("Please enter the exponent: ")
e = float(e)
s = b ** e
print()
print(str(b) + " to the power of " + str(e) + " is equal to " + str(s) + ".")
def square():
print()
n = input("Please enter a number to square (your number to the power of 2): ")
n = float(n)
s = n ** 2
print()
print(str(n) + " to the power of 2 is " + str(s) + ".")
def square_root():
print()
n = input("Please enter a number to find its square root: ")
n = float(n)
f = n ** 0.5
print()
print("The square root of " + str(n) + " is " + str(f) + ".")
def cube():
print()
n = input("Please enter a number to cube (your number to the power of 3): ")
n = float(n)
c = n ** 3
print()
print(str(n) + " to the power of 3 is " + str(c) + ".")
def cube_root():
print()
n = input("Please enter a number to find its cube root: ")
n = float(n)
f = n ** (1 / 3)
print()
print("The square root of " + str(n) + " is " + str(f) + ".")
def modulus():
print()
n = input("Please enter the number to apply the modulus to: ")
n = float(n)
m = input("Please enter the number to apply as the modulus for your number: ")
m = float(m)
mod = n % m
print()
print(str(n) + " mod " + str(m) + " is equal to " + str(mod) + ".")
# Length and Distance Conversion Procedures
def Length_and_Distance_Conversions():
print("Here are your options: ")
print()
print("A. Inches => Centimeters")
print("B. Centimeters => Inches")
print("C. Feet => Meters")
print("D. Meters => Feet")
print("E. Yards => Meters")
print("F. Meters => Yards")
print("G. Miles => Kilometers")
print("H. Kilometers => Miles")
print("I. Millimeters => Inches")
print("J. Inches => Millimeters")
sub2choice = input("Which one would you like to choose, A, B, C, D, E, F, G, H, I, or J? ")
sub2choice = sub2choice.upper()
if sub2choice == "A":
inch_to_cm()
yn = input("Do you wish to perform more operations in the length and distance conversions section (enter 'Y' for yes and 'N' for no)? ")
yn = yn.upper()
if yn == "Y":
Length_and_Distance_Conversions()
elif yn == "N":
Main_Menu()
elif sub2choice == "B":
cm_to_inch()
yn = input("Do you wish to perform more operations in the length and distance conversions section (enter 'Y' for yes and 'N' for no)? ")
yn = yn = yn.upper()
if yn == "Y":
Length_and_Distance_Conversions()
elif yn == "N":
Main_Menu()
elif sub2choice == "C":
ft_to_meters()
yn = input("Do you wish to perform more operations in the length and distance conversions section (enter 'Y' for yes and 'N' for no)? ")
yn = yn.upper()
if yn == "Y":
Length_and_Distance_Conversions()
elif yn == "N":
Main_Menu()
elif sub2choice == "D":
meters_to_ft()
yn = input("Do you wish to perform more operations in the length and distance conversions section (enter 'Y' for yes and 'N' for no)? ")
yn = yn.upper()
if yn == "Y":
Length_and_Distance_Conversions()
elif yn == "N":
Main_Menu()
elif sub2choice == "E":
yds_to_meters()
yn = input("Do you wish to perform more operations in the length and distance conversions section (enter 'Y' for yes and 'N' for no)? ")
yn = yn.upper()
if yn == "Y":
Length_and_Distance_Conversions()
elif yn == "N":
Main_Menu()
elif sub2choice == "F":
meters_to_yds()
yn = input("Do you wish to perform more operations in the length and distance conversions section (enter 'Y' for yes and 'N' for no)? ")
yn = yn.upper()
if yn == "Y":
Length_and_Distance_Conversions()
elif yn == "N":
Main_Menu()
elif sub2choice == "G":
miles_to_km()
yn = input("Do you wish to perform more operations in the length and distance conversions section (enter 'Y' for yes and 'N' for no)? ")
yn = yn.upper()
if yn == "Y":
Length_and_Distance_Conversions()
elif yn == "N":
Main_Menu()
elif sub2choice == "H":
km_to_miles()
yn = input("Do you wish to perform more operations in the length and distance conversions section (enter 'Y' for yes and 'N' for no)? ")
yn = yn.upper()
if yn == "Y":
Length_and_Distance_Conversions()
elif yn == "N":
Main_Menu()
elif sub2choice == "I":
mm_to_inch()
yn = input("Do you wish to perform more operations in the length and distance conversions section (enter 'Y' for yes and 'N' for no)? ")
yn = yn.upper()
if yn == "Y":
Length_and_Distance_Conversions()
elif yn == "N":
Main_Menu()
elif sub2choice == "J":
inch_to_mm()
yn = input("Do you wish to perform more operations in the length and distance conversions section (enter 'Y' for yes and 'N' for no)? ")
yn = yn.upper()
if yn == "Y":
Length_and_Distance_Conversions()
elif yn == "N":
Main_Menu()
else:
print("Please enter a valid option!")
Length_and_Distance_Conversions()
def inch_to_cm():
print()
inches = input("Please enter any amount of inches to be converted into centimeters: ")
inches = float(inches)
cm = inches * 2.5400
cm = float(cm)
print()
print(str(inches) + " inch(es) is equal to " + str(cm) + " centimeter(s).")
def cm_to_inch():
print()
cm = input("Please enter any amount of centimeters to be converted into inches: ")
cm = float(cm)
inches = cm * 0.3937
inches = float(inches)
print()
print(str(cm) + " centimeter(s) is equal to " + str(inches) + " inches).")
def ft_to_meters():
print()
ft = input("Please enter any amount of feet to be converted into meters: ")
ft = float(ft)
meters = ft * 0.3048
meters = float(meters)
print()
print(str(ft) + " feet is equal to " + str(meters) + " meter(s)."
"")
def meters_to_ft():
print()
meters = input("Please enter any amount of meters to be converted into feet: ")
meters = float(meters)
ft = meters * 3.2808
ft = float(ft)
print()
print(str(meters) + " meter(s) is equal to " + str(ft) + " feet.")
def yds_to_meters():
print()
yds = input("Please enter any amount of yards to be converted into meters: ")
yds = float(yds)
meters = yds * 0.9144
meters = float(meters)
print()
print(str(yds) + " yard(s) is equal to " + str(meters) + " meter(s).")
def meters_to_yds():
print()
meters = input("Please enter any amount of meters to be converted into yards: ")
meters = float(meters)
yds = meters * 1.0936
yds = float(yds)
print(str(meters) + " meter(s) is equal to " + str(yds) + " yard(s).")
def miles_to_km():
print()
miles = input("Please enter any amount of miles to be converted to kilometers: ")
miles = float(miles)
km = miles * 1.6093
km = float(km)
print(str(miles) + " mile(s) is equal to " + str(km) + " kilometer(s).")
def km_to_miles():
print()
km = input("Please enter any amount of kilometers to be converted into miles: ")
km = float(km)
miles = km * 0.6214
miles = float(miles)
print(str(km) + " kilometer(s) is equal to " + str(miles) + " mile(s).")
def mm_to_inch():
print()
mm = input("Please enter any amount of millimeters to be converted into inches: ")
mm = float(mm)
inch = mm * 0.0394
inch = float(inch)
print(str(mm) + " millimeter(s) is equal to " + str(inch) + " inch(es).")
def inch_to_mm():
print()
inch = input("Please enter any amount of inches to be converted into millimeters: ")
inch = float(inch)
mm = inch * 25.4
mm = float(mm)
print(str(inch) + " inch(es) is equal to " + str(mm) + " millimeter(s).")
# Surface or Area Conversion Procedures
def Surface_or_Area_Conversions():
print("Oh, so you want to perform a conversion related to area.")
print()
print("Here are your options:")
print("A. Square Feet => Square Meters")
print("B. Square Meters => Square Feet")
print("C. Square Yards => Square Meters")
print("D. Square Meters => Square Yards")
print("E. Square Miles => Square Kilometers")
print("F. Square Kilometers => Square Miles")
print("G. Hectares => Acres")
print("H. Acres => Hectares")
print()
sub3choice = input("Which one would you like to choose, A, B, C, D, E, F, G, or H? ")
sub3choice = sub3choice.upper()
if sub3choice == "A":
sqft_to_sqmeters()
yn = input("Do you wish to perform more operations in the surface or area conversions section (enter 'Y' for yes and 'N' for no)? ")
yn = yn.upper()
if yn == "Y":
Surface_or_Area_Conversions()
elif yn == "N":
Main_Menu()
elif sub3choice == "B":
sqmeters_to_sqft()
yn = input("Do you wish to perform more operations in the surface or area conversions section (enter 'Y' for yes and 'N' for no)? ")
yn = yn.upper()
if yn == "Y":
Surface_or_Area_Conversions()
elif yn == "N":
Main_Menu()
elif sub3choice == "C":
sqyd_to_sqmeters()
yn = input("Do you wish to perform more operations in the surface or area conversions section (enter 'Y' for yes and 'N' for no)? ")
yn = yn.upper()
if yn == "Y":
Surface_or_Area_Conversions()
elif yn == "N":
Main_Menu()
elif sub3choice == "D":
sqmeters_to_sqyd()
yn = input("Do you wish to perform more operations in the surface or area conversions section (enter 'Y' for yes and 'N' for no)? ")
yn = yn.upper()
if yn == "Y":
Surface_or_Area_Conversions()
elif yn == "N":
Main_Menu()
elif sub3choice == "E":
sqmiles_to_sqkm()
yn = input("Do you wish to perform more operations in the surface or area conversions section (enter 'Y' for yes and 'N' for no)? ")
yn = yn.upper()
if yn == "Y":
Surface_or_Area_Conversions()
elif yn == "N":
Main_Menu()
elif sub3choice == "F":
sqkm_to_sqmiles()
yn = input("Do you wish to perform more operations in the surface or area conversions section (enter 'Y' for yes and 'N' for no)? ")
yn = yn.upper()
if yn == "Y":
Surface_or_Area_Conversions()
elif yn == "N":
Main_Menu()
elif sub3choice == "G":
hec_to_acr()
yn = input("Do you wish to perform more operations in the surface or area conversions section (enter 'Y' for yes and 'N' for no)? ")
yn = yn.upper()
if yn == "Y":
Surface_or_Area_Conversions()
elif yn == "N":
Main_Menu()
elif sub3choice == "H":
acr_to_hec()
yn = input("Do you wish to perform more operations in the surface or area conversions section (enter 'Y' for yes and 'N' for no)? ")
yn = yn.upper()
if yn == "Y":
Surface_or_Area_Conversions()
elif yn == "N":
Main_Menu()
else:
print("Please enter a valid option!")
Surface_or_Area_Conversions()
def sqft_to_sqmeters():
print()
sqft = input("Please enter any amount of square feet to be converted into square meters: ")
sqft = float(sqft)
sqmeters = sqft * 0.0929
sqmeters = float(sqmeters)
print()
print(str(sqft) + " square foot/feet is equal to " + str(sqmeters) + " square meter(s).")
def sqmeters_to_sqft():
print()
sqmeters = input("Please senter any amount of square meters to be converted into square feet: ")
sqmeters = float(sqmeters)
sqft = sqmeters * 10.764
sqft = float(sqft)
print()
print(str(sqmeters) + " square meter(s) is equal to " + str(sqft) + " square foot/feet.")
def sqyd_to_sqmeters():
print()
sqyd = input("Please enter any amount of square yards to be converted into square meters: ")
sqyd = float(sqyd)
sqmeters = sqyd * 0.8361
sqmeters = float(sqmeters)
print()
print(str(sqyd) + " square yard(s) is equal to " + str(sqmeters) + " square meter(s).")
def sqmeters_to_sqyd():
print()
sqmeters = input("Please enter any amount of square meters to be converted into square yards: ")
sqmeters = float(sqmeters)
sqyd = sqmeters * 1.196
sqyd = float(sqyd)
print(str(sqmeters) + " square meter(s) is equal to " + str(sqyd) + " square yard(s).")
def sqmiles_to_sqkm():
print()
sqmiles = input("Please enter any amount of square miles to be converted into square kilometers: ")
sqmiles = float(sqmiles)
sqkm = sqmiles * 2.5900
sqkm = float(sqkm)
print()
print(str(sqmiles) + " square mile(s) is equal to " + str(sqkm) + " square kilometer(s).")
def sqkm_to_sqmiles():
print()
sqkm = input("Please enter any amount of square kilometers to be converted into square miles: ")
sqkm = float(sqkm)
sqmiles = sqkm * 0.3861
sqmiles = float(sqmiles)
print()
print(str(sqkm) + " square kilometer(s) is equal to " + str(sqmiles) + " square mile(s).")
def hec_to_acr():
print()
hec = input("Please enter any number of hectares to be converted into acres: ")
hec = float(hec)
acr = hec * 2.4710
acr = float(acr)
print()
print(str(hec) + " hectare(s) is equal to " + str(acr) + " acre(s).")
def acr_to_hec():
print()
acr = input("Please enter any amount of acres to be converted into hectares: ")
acr = float(acr)
hec = acr / 2.471
hec = float(hec)
print()
print(str(acr) + " acre(s) is equal to " + str(hec) + " hectare(s).")
# Volume and Capacity (Liquid)
def Volume_and_Capacity_Conversions():
print()
print("Here are your options: ")
print("A. Pints => Liters")
print("B. Liters => Pints")
print("C. Quarts => Liters")
print("D. Liters => Quarts")
print("E. Gallons => Liters")
print("F. Liters => Gallons")
print()
sub4choice = input("Which option would you like to choose, A, B, C, D, E, or F? ")
sub4choice = sub4choice.upper()
print()
if sub4choice == "A":
pints_to_liters()
yn = input("Do you wish to perform more operations in the volume and capacity conversions section (enter 'Y' for yes and 'N' for no)? ")
yn = yn.upper()
if yn == "Y":
Volume_and_Capacity_Conversions()
elif yn == "N":
Main_Menu()
elif sub4choice == "B":
liters_to_pints()
yn = input("Do you wish to perform more operations in the volume and capacity conversions section (enter 'Y' for yes and 'N' for no)? ")
yn = yn.upper()
if yn == "Y":
Volume_and_Capacity_Conversions()
elif yn == "N":
Main_Menu()
elif sub4choice == "C":
quarts_to_liters()
yn = input("Do you wish to perform more operations in the volume and capacity conversions section (enter 'Y' for yes and 'N' for no)? ")
yn = yn.upper()
if yn == "Y":
Volume_and_Capacity_Conversions()
elif yn == "N":
Main_Menu()
elif sub4choice == "D":
liters_to_quarts()
yn = input("Do you wish to perform more operations in the volume and capacity conversions section (enter 'Y' for yes and 'N' for no)? ")
yn = yn.upper()
if yn == "Y":
Volume_and_Capacity_Conversions()
elif yn == "N":
Main_Menu()
elif sub4choice == "E":
gallons_to_liters()
yn = input("Do you wish to perform more operations in the volume and capacity conversions section (enter 'Y' for yes and 'N' for no)? ")
yn = yn.upper()
if yn == "Y":
Volume_and_Capacity_Conversions()
elif yn == "N":
Main_Menu()
elif sub4choice == "F":
liters_to_gallons()
yn = input("Do you wish to perform more operations in the volume and capacity conversions section (enter 'Y' for yes and 'N' for no)? ")
yn = yn.upper()
if yn == "Y":
Volume_and_Capacity_Conversions()
elif yn == "N":
Main_Menu()
else:
print("Please enter a valid option!")
Volume_and_Capacity_Conversions()
def pints_to_liters():
print()
pints = input("Please enter any amount of pints to be converted liters: ")
pints = float(pints)
liters = pints * 0.4732
liters = float(liters)
print(str(pints) + " pint(s) is equal to " + str(liters) + " liter(s).")
def liters_to_pints():
print()
liters = input("Please enter any amount of liters to be converted into pints: ")
liters = float(liters)
pints = liters * 2.1134
pints = float(pints)
print(str(liters) + " liter(s) is equal to " + str(pints) + " pint(s).")
def quarts_to_liters():
print()
quarts = input("Please enter any amount of quarts to be converted into liters: ")
quarts = float(quarts)
liters = quarts * 0.9463
liters = float(liters)
print(str(quarts) + " quart(s) is equal to " + str(liters) + " liter(s).")
def liters_to_quarts():
print()
liters = input("Please enter any amount of liters to be converted into quarts: ")
liters = float(liters)
quarts = liters * 1.0567
quarts = float(quarts)
print(str(liters) + " liter(s) is equal to " + str(quarts) + " quart(s).")
def gallons_to_liters():
print()
gallons = input("Please enter any amount of gallons to be converted into liters: ")
gallons = float(gallons)
liters = gallons * 3.7853
liters = float(liters)
print(str(gallons) + " gallon(s) is equal to " + str(liters) + " liter(s).")
def liters_to_gallons():
print()
liters = input("Please enter any amount of liters to be converted into gallons: ")
liters = float(liters)
gallons = liters * 0.2642
gallons = float(gallons)
print(str(liters) + " liter(s) is equal to " + str(gallons) + " gallon(s).")
# Weight and Mass Conversions
def Weight_and_Mass_Conversions():
print()
print("Here are your options: ")
print("A. Ounces => Grams")
print("B. Grams => Ounces")
print("C. Pounds => Kilograms")
print("D. Kilograms => Pounds")
print("E. Short Tons => Metric Tons")
print("F. Metric Tons => Short Tons")
print()
sub5choice = input("Which would you like to choose, A, B, C, D, E, or F? ")
sub5choice = sub5choice.upper()
print()
if sub5choice == "A":
ounces_to_grams()
yn = input("Do you wish to perform more operations in the weight and mass conversions section (enter 'Y' for yes and 'N' for no)? ")
print(yn)
yn = yn.upper()
if yn == "Y":
Weight_and_Mass_Conversions()
elif yn == "N":
Main_Menu()
elif sub5choice == "B":
grams_to_ounces()
yn = input("Do you wish to perform more operations in the weight and mass conversions section (enter 'Y' for yes and 'N' for no)? ")
yn = yn.upper()
if yn == "Y":
Weight_and_Mass_Conversions()
elif yn == "N":
Main_Menu()
elif sub5choice == "C":
pounds_to_kgs()
yn = input("Do you wish to perform more operations in the weight and mass conversions section (enter 'Y' for yes and 'N' for no)? ")
yn = yn.upper()
if yn == "Y":
Weight_and_Mass_Conversions()
elif yn == "N":
Main_Menu()
elif sub5choice == "D":
kgs_to_pounds()
yn = input("Do you wish to perform more operations in the weight and mass conversions section (enter 'Y' for yes and 'N' for no)? ")
yn = yn.upper()
if yn == "Y":
Weight_and_Mass_Conversions()
elif yn == "N":
Main_Menu()
elif sub5choice == "E":
st_to_mt()
yn = input("Do you wish to perform more operations in the weight and mass conversions section (enter 'Y' for yes and 'N' for no)? ")
yn = yn.upper()
if yn == "Y":
Weight_and_Mass_Conversions()
elif yn == "N":
Main_Menu()
elif sub5choice == "F":
mt_to_st()
yn = input("Do you wish to perform more operations in the weight and mass conversions section (enter 'Y' for yes and 'N' for no)? ")
yn = yn.upper()
if yn == "Y":
Weight_and_Mass_Conversions()
elif yn == "N":
Main_Menu()
else:
print("Please enter a valid option!")
Weight_and_Mass_Conversions()
def ounces_to_grams():
print()
ounces = input("Please enter any amount of ounces to be converted into grams: ")
ounces = float(ounces)
grams = ounces * 28.3495
grams = float(grams)
print(str(ounces) + " ounce(s) is equal to " + str(grams) + " gram(s).")
def grams_to_ounces():
print()
grams = input("Please enter any amount of grams to be converted into ounces: ")
grams = float(grams)
ounces = grams / 28.35
ounces = float(ounces)
print(str(grams) + " gram(s) is equal to " + str(ounces) + " ounce(s).")
def pounds_to_kgs():
print()
pounds = input("Please enter any amount of pounds to be converted into kilograms: ")
pounds = float(pounds)
kgs = pounds * 0.4536
kgs = float(kgs)
print(str(pounds) + " pound(s) is equal to " + str(kgs) + " kilogram(s).")
def kgs_to_pounds():
print()
kgs = input("Please enter any amount of kilograms to be converted into pounds: ")
kgs = float(kgs)
pounds = kgs * 2.2046
pounds = float(pounds)
print(str(kgs) + " kilogram(s) is equal to " + str(pounds) + " pound(s).")
def st_to_mt():
print()
st = input("Please enter any amount of short tons to be converted into metric tons: ")
st = float(st)
mt = st * 0.9072
mt = float(mt)
print(str(st) + " short ton(s) is equal to " + str(mt) + " metric ton(s).")
def mt_to_st():
print()
mt = input("Please enter any amount of metric tons to be converted into short tons: ")
mt = float(mt)
st = mt * 1.1023
st = float(st)
print(str(mt) + " metric ton(s) is equal to " + str(st) + " short ton(s).")
# Temperature
def Temperature_Conversions():
print()
print("Here are your options: ")
print()
print("A. Fahrenheit => Celsius")
print("B. Celsius => Fahrenheit")
print()
sub6choice = input("Which would you like to choose, A or B? ")
sub6choice = sub6choice.upper()
if sub6choice == "A":
f_to_c()
yn = input("Do you wish to perform more operations in the temperature conversions section (enter 'Y' for yes and 'N' for no)? ")
yn = yn.upper()
if yn == "Y":
Temperature_Conversions()
elif yn == "N":
Main_Menu()
elif sub6choice == "B":
c_to_f()
yn = input("Do you wish to perform more operations in the temperature conversions section (enter 'Y' for yes and 'N' for no)? ")
yn = yn.upper()
if yn == "Y":
Temperature_Conversions()
elif yn == "N":
Main_Menu()
else:
print("Please enter a valid option!")
Temperature_Conversions()
def f_to_c():
print()
f = input("Please enter any amount of degrees of fahrenheit to be converted to celsius: ")
f = float(f)
c = ((f - 32) / 1.8)
c = float(c)
print(str(f) + " degree(s) fahrenheit is equal to " + str(c) + " degree(s) celsius.")
def c_to_f():
print()
c = input("Please enter any amount of degrees of celsius to be converted to fahrenheit: ")
c = float(c)
f = ((c * 1.8) + 32)
f = float(f)
print(str(f) + " degree(s) celsius is equal to " + str(c) + " degree(s) fahrenheit.")
def Main_Menu():
print("What would you like to do?")
print()
print("MAIN MENU")
print()
print("-------------------------")
print()
print("1. Calculations")
print()
print("2. Length and Distance Conversions")
print()
print("3. Area Conversions")
print()
print("4. Volume Conversions")
print()
print("5. Weight Conversions")
print()
print("6. Temperature Conversions")
print()
print()
main_choice = input("Which one would you like to choose, 1, 2, 3, 4, 5, 6? ")
if main_choice == "1":
Calculations()
elif main_choice == "2":
Length_and_Distance()
elif main_choice == "3":
Surface_or_Area_Conversions()
elif main_choice == "4":
Volume_and_Capacity_Conversions()
elif main_choice == "5":
Weight_and_Mass_Conversions()
elif main_choice == "6":
Temperature_Conversions()
else:
print("Please enter a valid option!")
Main_Menu()
# -------------------------------------------------------------------------------------------------------------------
print("Hello!")
print()
print("Welcome to the Scientific Calculator!")
Main_Menu() Click Run or press shift + ENTER to run code