def temp_conversion(): temp = float(input("Enter temperature: ")) unit = input("Enter('C' for Celsius or 'F' for Fahrenheit): ") if unit == "C" or unit == "c" : newTemp = 9 / 5 * temp + 32 print("Temperature in Fahrenheit =", newTemp) elif unit == "F" or unit == "f" : newTemp = 5 / 9 * (temp - 32) print ("Temperature in Celsius =", newTemp) else : print("Unknown unit.", unit)


To run this program, first enter the temperature in digits and then the unit C or F in the dialog box. If you enter C, the temperature is converted from Celsius to Fahrenheit and vice versa.