Apr-02-2017, 07:08 PM
here is the latest code I've done. I need to clean it up some more but just thought I'd post it up. Also fishing for pointers or advice on how it looks so far.
import random good_bye = ['A goodbye isn’t painful unless you’re never going to say hello again.', 'A man never knows how to say goodbye; a woman never knows when to say it.', 'As contraries are known by contraries, so is the delight of presence best known by the torments of absence.', 'Be well, do good work, and keep in touch.', 'Being strong sometimes means being able to let go.', 'But fate ordains that dearest friends must part.', 'All those moments will be lost in time, like tears in rain.'] def Conversion_type(): while True: P1 = input("Is your conversion:[1]ML and OZ, [2] C and F, [3]Grams and OZ, [4]SG and API, [5] SG to PPG, [Q] to quit ") print (P1) if P1 == "1": Fluid_converter() elif P1 == "2": Temp_converter() elif P1 == "3": Grams_ounces() elif P1 == "4": API_Specific_gravity() elif P1 == "5": SG_PPG() elif P1.lower == "q": quit() def Fluid_converter(): while True: P1 = input("Convert to ML,OZ (select one), 'Q'=quit: ") print (P1) if P1.lower() == "ml": Volume = float(input("What is your Volume?")) answer = (Volume / 29.5735296) print(round(answer, 4)) elif P1.lower() == "oz": Volume = float(input("What is your Volume?")) answer = (Volume * 29.5735296) print(round(answer, 4)) elif P1.lower() == 'q': break def Temp_converter(): while True: P1 = input("Convert to C,F (select one), 'Q'=quit: ") print (P1) if P1.lower() == "c": Temp = float(input("What is your temperature?")) print(((Temp) * (9/5)) + 32) elif P1.lower() == "f": Temp = float(input("What is your temperature?")) print(((Temp) - 32) * (5/9)) elif P1.lower() == 'q': break def grams_ounces(): while True: P1 = input("Convert to G,OZ (select one), 'Q'=quit: ") print (P1) if P1.lower() == "g": mass = float(input("What is your mass?")) answer = ((mass) / 28.35) print(round(answer, 4)) elif P1.lower() == "oz": mass = float(input("What is your mass?")) answer = ((mass) * 28.35) print(round(answer, 4)) elif P1.lower() == 'q': break def API_Specific_gravity(): while True: P1 = input("Convert [API] and [SG] (select one), 'Q'=quit: ") print (P1) if P1.lower() == "api": value = float(input("What is your value?")) answer = ((141.5)/((value)+ 131.5)) print(round(answer, 4)) elif P1.lower() == "sg": value = float(input("What is your value SG?")) answer = (((141.5)/(value)) - 131.5) print(round(answer, 4)) elif P1.lower == 'q': break def SG_PPG(): while True: P1 = input("SG or PPG, 'Q'=quit: ") print (P1) if P1.lower() == "sg": Value = float(input("What is your Value?")) answer = ((Value) * 8.33) print(round(answer, 4)) elif P1.lower() == "ppg": Value = float(input("What is your Value?")) answer = (Value / 8.33) print(round(answer, 4)) elif P1.lower() == 'q': break print("Let's get this party started!") Conversion_type() print((random.choice)(good_bye))