Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
def convert ():
    convert_unit = input("Would you like to convert to Fahrenheit or Celsius? Please use F or C: ")
    convert_number = int(input("What number would you like to convert?: "))
    if convert_unit == "F" or "f":
        f_temp =(convert_number * 9/5) + 32
        print (str(convert_number) + " Celsius converts to " + str(f_temp) +" Fahrenheit")
    elif convert_unit == "C" or "c":
        c_temp = (convert_number - 32) * 5/9 
        print (str(convert_number) + "Fahrenheit converts to " + str(f_temp) +" Celsius")
    else:
        print("Invalid entry")
        
convert()