Files
wehub-resource-sync dde272c4b8
i18n - Build Validation / Validate i18n Builds (24) (push) Has been cancelled
CI - Node.js / Lint (24) (push) Has been cancelled
CI - Node.js / Build (24) (push) Has been cancelled
CI - Node.js / Test (24) (push) Has been cancelled
CI - Node.js / Test - Upcoming Changes (24) (push) Has been cancelled
CI - Node.js / Test - i18n (italian, 24) (push) Has been cancelled
CI - Node.js / Test - i18n (portuguese, 24) (push) Has been cancelled
CD - Docker - GHCR Images / Build and Push Images (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 11:55:53 +08:00

84 lines
1.5 KiB
Markdown

---
id: 699c8e045ee7cb94ed2322d9
title: "Challenge 218: Evenly Divisible"
challengeType: 29
dashedName: challenge-218
---
# --description--
Given two integers, determine if you can evenly divide the first one by the second one.
# --hints--
`is_evenly_divisible(4, 2)` should return `True`.
```js
({test: () => { runPython(`
from unittest import TestCase
TestCase().assertIs(is_evenly_divisible(4, 2), True)`)
}})
```
`is_evenly_divisible(7, 3)` should return `False`.
```js
({test: () => { runPython(`
from unittest import TestCase
TestCase().assertIs(is_evenly_divisible(7, 3), False)`)
}})
```
`is_evenly_divisible(5, 10)` should return `False`.
```js
({test: () => { runPython(`
from unittest import TestCase
TestCase().assertIs(is_evenly_divisible(5, 10), False)`)
}})
```
`is_evenly_divisible(48, 6)` should return `True`.
```js
({test: () => { runPython(`
from unittest import TestCase
TestCase().assertIs(is_evenly_divisible(48, 6), True)`)
}})
```
`is_evenly_divisible(3186, 9)` should return `True`.
```js
({test: () => { runPython(`
from unittest import TestCase
TestCase().assertIs(is_evenly_divisible(3186, 9), True)`)
}})
```
`is_evenly_divisible(4192, 11)` should return `False`.
```js
({test: () => { runPython(`
from unittest import TestCase
TestCase().assertIs(is_evenly_divisible(4192, 11), False)`)
}})
```
# --seed--
## --seed-contents--
```py
def is_evenly_divisible(a, b):
return a
```
# --solutions--
```py
def is_evenly_divisible(a, b):
return a % b == 0
```