0% found this document useful (0 votes)
31 views1 page

Python Program To Convert Celsius To Fahrenheit

Uploaded by

Wakaye Abba
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views1 page

Python Program To Convert Celsius To Fahrenheit

Uploaded by

Wakaye Abba
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

#Python Program to Convert Celsius To Fahrenheit and Vice Versa

def Temperature():

temp=str(input("Type C to convert to celsius and F to fahrenheit"))

if temp=="C":

celsius = float(input("Enter temperature in celsius: "))

fahrenheit = (celsius * 9/5) + 32

print('%.2f Celsius is: %0.2f Fahrenheit' %(celsius, fahrenheit))

elif temp=="F":

fahrenheit = float(input("Enter temperature in fahrenheit: "))

celsius = (fahrenheit - 32) * 5/9

print('%.2f Fahrenheit is: %0.2f Celsius' %(fahrenheit, celsius))

return

Temperature()

You might also like