Converts Fahrenheit to Celsius.
- Follow the conversion formula
C = (F - 32) * 5 / 9
.
代码实现
def fahrenheit_to_celsius(degrees):
return ((degrees - 32) * 5 / 9)
使用样例
fahrenheit_to_celsius(77) # 25.0
翻译自:https://www.30secondsofcode.org/python/s/fahrenheit-to-celsius