Nest all content into snippets

This commit is contained in:
Angelos Chalaris
2023-05-07 16:07:29 +03:00
parent 2ecadbada9
commit 6a45d2ec07
1240 changed files with 0 additions and 0 deletions

View File

@ -0,0 +1,22 @@
---
title: Number to hex
type: snippet
language: python
tags: [math]
cover: green-plant
dateModified: 2020-10-09T09:45:47+03:00
---
Returns the hexadecimal representation of the given number.
- Use `hex()` to convert a given decimal number into its hexadecimal equivalent.
```py
def to_hex(dec):
return hex(dec)
```
```py
to_hex(41) # 0x29
to_hex(332) # 0x14c
```