Files
30-seconds-of-code/snippets/celsius_to_fahrenheit.md
2020-09-15 16:25:15 +03:00

18 lines
326 B
Markdown

---
title: celsius_to_fahrenheit
tags: math,beginner
---
Converts Celsius to Fahrenheit.
- Use the formula `fahrenheit = (celsius * 1.8) + 32` to convert from Celsius to Fahrenheit.
```py
def celsius_to_fahrenheit(celsius):
return ((celsius * 1.8) + 32)
```
```py
celsius_to_fahrenheit(180) # 356.0
```