Files
30-seconds-of-code/snippets/python/s/celsius-to-fahrenheit.md
Angelos Chalaris 4d0316a062 Update covers
2023-05-07 22:25:00 +03:00

23 lines
373 B
Markdown

---
title: Celsius to Fahrenheit
type: snippet
language: python
tags: [math]
unlisted: true
cover: reflection-on-lake
dateModified: 2021-01-04T12:47:04+02:00
---
Converts Celsius to Fahrenheit.
- Follow the conversion formula `F = 1.8 * C + 32`.
```py
def celsius_to_fahrenheit(degrees):
return ((degrees * 1.8) + 32)
```
```py
celsius_to_fahrenheit(180) # 356.0
```