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