105,547 views
12 votes
12 votes
Write a menu driven program in python to convert the given temperature from fahrenheit to celsius and vice versa depending upon user's choice.​

User Hugo Dozois
by
4.0k points

1 Answer

4 votes
4 votes

Answer:

See below

Step-by-step explanation:

while(True):

print("""\\Program to convert temperatures

Choose from:

1. Fahrenheit to Celsius

2. Celsius to Fahrenheit

3. Exit program""")

choice = int(input("\\Enter your choice: "))

#print()

if (choice == 1):

print("Converting degrees Fahrenheight to degrees Celsius\\")

F = float(input("Enter temperature in degrees Fahrenheit: "))

C = (F - 32) * 5/9

print()

print(F,"degrees Fahrenheit = ", C, "degrees Celsius\\")

elif (choice == 2):

print("Converting degrees Celsius to degrees Fahrenheit\\")

C = float(input("Enter temperature in degrees Celsius:"))

F = (C* 9/5) + 32

print()

print(C,"degrees Celsius = ", F, "degrees Fahrenheit\\")

elif (choice == 3):

print("Exiting program")

break

else:

print("Invalid Entry!. Please re-enter")

User Mehmetozer
by
3.7k points