Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added new python snippet #1962

Closed
wants to merge 4 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions snippets/python/s/kelvin-to-celsius.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
title: Kelvin to celsius
type: snippet
language: python
tags: [math]
cover: boutique-home-office-4
dateModified: 2023-07-13T08:30:00+05:00
---

Converts kelvin into celsius degrees.
- Use `round()` with the perameter `2` to return only 2 numbers after decimal point.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

parameter* is misspelled 🙂


```py
def kelvinToCelsius(kelvin):
temp = round(kelvin - 273.15, 2)
return temp
```

```py
kelvinToCelsius(298.65) #

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add the result after the comment

```