How To Convert Temperature From 1 Unit To Another

      #TEMPERATURE CONVERTER



print('TEMPERATURE CONVERTER')

print('\nPlease Enter The Unit in BLOCK LETTERS')

t=int(input('\nEnter Temperature = '))
u=input('\nEnter Unit ( C / F / K) :- ')
ct=input('\nEnter Conversion Unit (C / F / K) :- ')
nt=0

if(u=='C' and ct=='F'):
    nt=(t*(9/5))+32
elif(u=='C' and ct=='K'):
    nt=t+273
elif(u=='F' and ct=='C'):
    nt=(t*(5/9))-32
elif(u=='F' and ct=='K'):
    nt=(t*(5/9))-32+273
elif(u=='K' and ct=='C'):
    nt=t-273
elif(u=='K' and ct=='F'):
    nt=(t-273)*(9/5)+32
else:
    print('\nERROR IN THE INPUT.\n PLEASE TRY AGAIN.')
    quit()

print ('\nThe Temperature =',str(nt),ct )


Made By :- 
         Nilay Saraf


    

Comments

Popular Posts