Header Ads Widget

Responsive Advertisement

Temparature Convertion (F to C & C to F)

 


# Fahrenheit To Celcius And Celcius to Fahrenheit
def far(c) :
    return ((c*9)/5)+32

def cel(f):
    return ((f-32)*5)/9        

x = input ("Enter 'c' For Temparature in Celcius &\nEnter 'f' For Temparature in Fahrenheit : \n")
if(x=="f"):
    a = int(input ("Enter Temparature in Celcius : "))
    print ("\nThe Temparature in Fahrenheit is :",far(a))
else :
    b = int(input ("Enter Temparature in Fahrenheit : "))
    print ("\nThe Temparature in Celcius is :",cel(b))


Post a Comment

0 Comments