How to convert fahrenheit to celsius in Python

3 Answers

0 votes
f = 1.0

c = (f - 32) / 1.8

print("{0} fahrenheit = {1} celsius".format(round(f, 2), round(c, 2)))




'''
run:

1.0 fahrenheit = -17.22 celsius

'''

 



answered Feb 19, 2016 by avibootz
edited Jul 22, 2022 by avibootz
0 votes
f = 1.0

c = (f - 32) * (5.0 / 9.0)

print("{0} fahrenheit = {1} celsius".format(round(f, 2), round(c, 2)))




'''
run:

1.0 fahrenheit = -17.22 celsius

'''

 



answered Feb 19, 2016 by avibootz
edited Jul 22, 2022 by avibootz
0 votes
fahrenheit = 96
       
celsius = (fahrenheit - 32) * 5 / 9.0
       
print("Celsius = " + str(celsius))   
  
 
 
  
'''
run:
  
Celsius = 35.55555555555556
  
'''

 



answered Jul 22, 2022 by avibootz

Related questions

1 answer 110 views
2 answers 223 views
1 answer 120 views
1 answer 110 views
1 answer 101 views
1 answer 111 views
...