def Fah():
F=int(input('Enter the temperature on Fahrenheit(F)'))
C=(F - 32) * 5/9
K=(F - 32) * 5/9 + 273.15
print("Fahrenheit Value :",F)
print("Celsius Value :",C)
print("Kelvin Value:",K)
def Cel():
C=int(input('Enter the temperature on Celsius(C)'))
F=(C * 9/5) + 32
K=C + 273.15
print("Fahrenheit Value :",F)
print("Celsius Value :",C)
print("Kelvin Value:",K)
def Kel():
K=int(input('Enter the temperature on Kelvin(K)'))
F=(K - 273.15) * 9/5 + 32
C=K - 273.15
print("Fahrenheit Value :",F)
print("Celsius Value :",C)
print("Kelvin Value:",K)
print("\n")
print('1.Fahrenheit to Celsius & Kelvin\n2.Celsius to Fahrenheit & Kelvin\n3.Kelvin to Fahrenheit & Celsius\n4.Exit')
n=int(input('Enter the choice:'))
if n==1:
Fah()
elif n==2:
Cel()
elif n==3:
Kel()
elif n==4:
exit()
else:
print('Invalid options')
No comments:
Post a Comment