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 is divisible
type: snippet
language: python
tags: [math]
unlisted: true
cover: interior-9
dateModified: 2021-01-04T12:47:04+02:00
---
Checks if the first numeric argument is divisible by the second one.
- Use the modulo operator (`%`) to check if the remainder is equal to `0`.
```py
def is_divisible(dividend, divisor):
return dividend % divisor == 0
```
```py
is_divisible(6, 3) # True
```