In [ ]:
#Create a program that.
# Asks if you want to convert the temp from Fahrenheit to Celsius, or Celsius to Fahrenheit.<<
# Accepts as input the temperature you enter
# Converts it to your choice
# Prints out the answer, using the .format() method in a complete statement.
# Asks if you want to go again.

#to celsius
#actualTemp = (temperature - 32) * (5/9)

#to fahrenheit
#actualTemp = (temperature * 9/5) + 32


# allows the program to restart
def main():
    #defining C
    c = input("press f for Fahrenheit to Celsius or c for Celsius to Fahrenheit ==>")
    #c equals the input and the f is for fahrenheit 
    if c =="f":
            temperature = int(input("whats the temperature? ==>"))
            #formula for the conversion
            actualTemp = (temperature -32) * (5/9)
    
            print("The temperature in celsius is",actualTemp)
        # the repeat statements are asking the user if they would want to try again when you press f
            Repeat = input("do you want to have another number converted to temperature? yes or no ==>")
            
            if Repeat =="yes":
                
                main()
                
            elif Repeat =="no":
                print("Have a good day!")
            #defining another variable 
            
        #The c is the input and the input is equaling the other c which is for celsius
    elif c == "c":
            temperature = int(input("whats the temperature? ==>"))
            #formula for conversion
            actualTemp = (temperature * 9/5) + 32
    
            print("The temperature in Fahrenheit  is",actualTemp)
            
            #asks you again if you want to repeat when you press c
            Repeat = input("do you want to have another number converted to temperature? yes or no ==>")
            
            if Repeat =="yes":
                
                main()
                
            elif Repeat =="no":
                print("Have a good day!") 
       #if I press another key besides f or c it allows me have a another chance of pressing f or c
    else: 
        print("press f or c")
        #deletes my variable c
        del c
        
        main()
                
        
  
    

main()
press f for Fahrenheit to Celsius or c for Celsius to Fahrenheit ==>
press f or c