Files
30-seconds-of-code/snippets/celsius_to_fahrenheit.md
b1nary-c0de f67edda7c5 Temperature Unit Conversion [FEATURE] (#194)
Celsius to Fahrenheit and back

Co-authored-by: Angelos Chalaris <chalarangelo@gmail.com>
2020-04-05 12:29:03 +03:00

18 lines
324 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
```