In [ ]:
#Python.Display is a library of a function.
def menu():
    print("1. Convert to Celsius") #This will be my first option 
    print("2. Convert to Fahrenheit")#This will be my second option
    print("x. Exit")#This will be my exit option
    myChoice = input("Enter what you want to do: ")#My first variable must contain one of the above options.
   
    if myChoice == "1":#It will go to my first option under the function convotofar, which will convert celsius to fahrenheit
        convotofar()
    
    if myChoice == "2":#It will go to my second option under the function convotocel, which will convert fahrenheit to celsius
        convotocel()
    
    if myChoice =="x":
        print("Goodnight")#It will exit which will end the program and say goodnight
    
    else:
        menu()
#Functions make it to where I can run multiple things in my program, and allow me to exit.          
def convotocel():
    f = float(input("Enter temp in fahrenheit: ")) #This is my formula in order to convert fahrenheit to celsius
    c = (f - 32)*5/9
    print(c)
    menu()
    
def convotofar():
    c = float(input("Enter temp in celsius: ")) #This is my formula in order to convert celsius to fahrenheit
    f = c*9/5+32
    print(f)
menu()
1. Convert to Celsius
2. Convert to Fahrenheit
x. Exit
Enter what you want to do: 1
Enter temp in celsius: 20
68.0
1. Convert to Celsius
2. Convert to Fahrenheit
x. Exit
Enter what you want to do: 2
Enter temp in fahrenheit: 40
4.444444444444445
1. Convert to Celsius
2. Convert to Fahrenheit
x. Exit
Enter what you want to do: x
Goodnight
1. Convert to Celsius
2. Convert to Fahrenheit
x. Exit
In [ ]: