#no validation for numerical value being entered for conversion
#12 inches in a foot, 3 feet in a yard, 1760 yards in a mile
#100cm in metre, 1000 metres in kilometre
#16 ounces in a pound, 14 pounds in a stone
#1000 grams in a kilogram, 1000 kilograms in a tonne

def c_f():
  print("\n")
  print("Converting Celsius to Farenheit")
  i = int(input("What value would you like to convert? "))
  converted = (i * 9/5) + 32
  print(str(converted) + " F")
  print("Returning to main menu...")
  print("\n")

def f_c():
  print("\n")
  print("Converting Farenheit to Celsius")
  i = int(input("What value would you like to convert? "))
  converted = (i - 32) * 5/9
  print(str(converted) + " C")
  print("Returning to main menu...")
  print("\n")

def cm_inch():
  print("\n")
  print("Converting CM to Inches")
  i = int(input("What value would you like to convert? "))
  converted = (i/2.54)
  print(str(converted) + " Inches")
  print("Returning to main menu...")
  print("\n")

def inch_cm():
  print("\n")
  print("Converting Inches to CM")
  i = int(input("What value would you like to convert? "))
  converted = (i*2.54)
  print(str(converted) + " CM")
  print("Returning to main menu...")
  print("\n")

def km_miles():
  print("\n")
  print("Converting KM to Miles")
  i = int(input("What value would you like to convert? "))
  converted = (i/1.60934)
  print(str(converted) + " Miles")
  print("Returning to main menu...")
  print("\n")

def miles_km():
  print("\n")
  print("Converting Miles to KM")
  i = int(input("What value would you like to convert? "))
  converted = (i*1.60934)
  print(str(converted) + " KM")
  print("Returning to main menu...")
  print("\n")

def c_k():
  print("\n")
  print("Converting Celcius to Kelvin")
  i = int(input("What value would you like to convert? "))
  converted = (i+ 273.15)
  print(str(converted) + " Kelvin")
  print("Returning to main menu...")
  print("\n")

def f_k():
  print("\n")
  print("Converting Farenheit to Kelvin")
  i = int(input("What value would you like to convert? "))
  converted = ((i*-32) * 5/9 + 273.15)
  print(str(converted) + " Kelvin")
  print("Returning to main menu...")
  print("\n")

def k_f():
  print("\n")
  print("Converting Farenheit to Kelvin")
  i = int(input("What value would you like to convert? "))
  converted = ((i-273.15) * 9/5 + 32)
  print(str(converted) + " Kelvin")
  print("Returning to main menu...")
  print("\n")

def k_c():
  print("\n")
  print("Converting Farenheit to Kelvin")
  i = int(input("What value would you like to convert? "))
  converted = (i-273.15)
  print(str(converted) + " Kelvin")
  print("Returning to main menu...")
  print("\n")

def inches_feet():
  print("\n")
  print("Converting Inches to Feet")
  i = int(input("What value would you like to convert? "))
  converted = (i/12)
  print(str(converted) + " Feet")
  print("Returning to main menu...")
  print("\n")

def feet_inches():
  print("\n")
  print("Converting Feet to Inches")
  i = int(input("What value would you like to convert? "))
  converted = (i*12)
  print(str(converted) + " Inches")
  print("Returning to main menu...")
  print("\n")

def lb_kg():
  print("\n")
  print("Converting Pounds (lb) to Kilo-Grams (KG)")
  i = int(input("What value would you like to convert? "))
  converted = (i/2.20462)
  print(str(converted) + " kg")
  print("Returning to main menu...")
  print("\n")

def kg_lb():
  print("\n")
  print("Converting Kilo-Grams (KG) to Pounds (lb)")
  i = int(input("What value would you like to convert? "))
  converted = (i*2.20462)
  print(str(converted) + " lb")
  print("Returning to main menu...")
  print("\n")

def stone_kg():
  print("\n")
  print("Converting Stone to Kilo-Grams (KG)")
  i = int(input("What value would you like to convert? "))
  converted = (i*6.35029)
  print(str(converted) + " kg")
  print("Returning to main menu...")
  print("\n")

def kg_stone():
  print("\n")
  print("Converting Kilo-Grams (KG) to Stone")
  i = int(input("What value would you like to convert? "))
  converted = (i/6.35029)
  print(str(converted) + " stone")
  print("Returning to main menu...")
  print("\n")

def oz_lb():
  print("\n")
  print("Converting Ounces (oz) to Pounds (lb)")
  i = int(input("What value would you like to convert? "))
  converted = (i/16)
  print(str(converted) + " lb")
  print("Returning to main menu...")
  print("\n")

def lb_oz():
  print("\n")
  print("Converting Pounds (lb) to Ounces (oz)")
  i = int(input("What value would you like to convert? "))
  converted = (i*16)
  print(str(converted) + " oz")
  print("Returning to main menu...")
  print("\n")

def stone_lb():
  print("\n")
  print("Converting Stone to Pounds (lb)")
  i = int(input("What value would you like to convert? "))
  converted = (i*14)
  print(str(converted) + " lb")
  print("Returning to main menu...")
  print("\n")

def lb_stone():
  print("\n")
  print("Converting Pounds (lb) to Stone")
  i = int(input("What value would you like to convert? "))
  converted = (i/14)
  print(str(converted) + " Stone")
  print("Returning to main menu...")
  print("\n")

def cm_feet():
  print("\n")
  print("Converting Centimetres (CM) to Feet")
  i = int(input("What value would you like to convert? "))
  converted = (i/30.48)
  print(str(converted) + " Feet")
  print("Returning to main menu...")
  print("\n")

def feet_cm():
  print("\n")
  print("Converting Feet to Centimetres (CM)")
  i = int(input("What value would you like to convert? "))
  converted = (i*30.48)
  print(str(converted) + " CM")
  print("Returning to main menu...")
  print("\n")

def feet_yards():
  print("\n")
  print("Converting Feet to Yards")
  i = int(input("What value would you like to convert? "))
  converted = (i/3)
  print(str(converted) + " Yards")
  print("Returning to main menu...")
  print("\n")

def yards_feet():
  print("\n")
  print("Converting Yards to Feet")
  i = int(input("What value would you like to convert? "))
  converted = (i*3)
  print(str(converted) + " Feet")
  print("Returning to main menu...")
  print("\n")

def menu():
  menu_flag = True
  while menu_flag == True:
    response = input("Please select conversion type:\
    \n\
    \nTemperature\
    \n(a) Celcius to Farenheit\
    \n(b) Celcius to Kelvin\
    \n(c) Farenheit to Celcius\
    \n(d) Farenheit to Kelvin\
    \n(e) Kelvin to Celcius\
    \n(f) Kelvin to Farenheit\
    \n\
    \nLength\
    \n(g) CM to Inch\
    \n(h) Inch to CM\
    \n(i) KM to Miles\
    \n(j) Miles to KM\
    \n(k) Inches to Feet\
    \n(l) Feet to Inches\
    \n(m) CM to Feet\
    \n(n) Feet to CM\
    \n(o) Feet to Yards\
    \n(p) Yards to Feet\
    \n\
    \nMass\
    \n(q) Pounds (lb) to Kilogram (KG)\
    \n(r) Kilogram (KG) to Pounds (lb)\
    \n(s) Stone to Kilogram (KG)\
    \n(t) Kilogram (KG) to Stone\
    \n(u) Ounces (oz) to Pounds (lb)\
    \n(v) Pounds (lb) to Ounces (oz)\
    \n(w) Stone to Pounds (lb)\
    \n(y) Pounds (lb) to Stone\
    \n\
    \n(x) Exit\n")

    if response.lower() == "a":
      c_f()
    elif response.lower() == "b":
      c_k()
    elif response.lower() == "c":
      f_c()
    elif response.lower() == "d":
      f_k()
    elif response.lower() == "e":
      k_c()
    elif response.lower() == "f":
      k_f()
    elif response.lower() == "g":
      cm_inch()
    elif response.lower() == "h":
      inch_cm()
    elif response.lower() == "i":
      km_miles()
    elif response.lower() == "j":
      miles_km()
    elif response.lower() == "k":
      inches_feet()
    elif response.lower() == "l":
      feet_inches()
    elif response.lower() == "m":
      cm_feet()
    elif response.lower() == "n":
      feet_cm()
    elif response.lower() == "o":
      feet_yards()
    elif response.lower() == "p":
      yards_feet()
    elif response.lower() == "q":
      lb_kg()
    elif response.lower() == "r":
      kg_lb()
    elif response.lower() == "s":
      stone_kg()
    elif response.lower() == "t":
      kg_stone()
    elif response.lower() == "u":
      oz_lb()
    elif response.lower() == "v":
      lb_oz()
    elif response.lower() == "w":
      stone_lb()
    elif response.lower() == "y":
      lb_stone()
    elif response.lower() == "z":
      pass
    elif response.lower() == "x":
      menu_flag = False

menu()
