23 lines
373 B
Markdown
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
|
|
```
|