Nest all content into snippets
This commit is contained in:
22
snippets/python/s/fahrenheit-to-celsius.md
Normal file
22
snippets/python/s/fahrenheit-to-celsius.md
Normal file
@ -0,0 +1,22 @@
|
||||
---
|
||||
title: Fahrenheit to Celsius
|
||||
type: snippet
|
||||
language: python
|
||||
tags: [math]
|
||||
unlisted: true
|
||||
cover: last-light
|
||||
dateModified: 2021-01-04T12:47:04+02:00
|
||||
---
|
||||
|
||||
Converts Fahrenheit to Celsius.
|
||||
|
||||
- Follow the conversion formula `C = (F - 32) * 5 / 9`.
|
||||
|
||||
```py
|
||||
def fahrenheit_to_celsius(degrees):
|
||||
return ((degrees - 32) * 5 / 9)
|
||||
```
|
||||
|
||||
```py
|
||||
fahrenheit_to_celsius(77) # 25.0
|
||||
```
|
||||
Reference in New Issue
Block a user