반응형
In this Kata we are passing a number (n) into a function.
Your code will determine if the number passed is even (or not).
The function needs to return either a true or false.
Numbers may be positive or negative, integers or floats.
Floats with decimal part non equal to zero are considered UNeven for this kata.
Solution:
def is_even(n):
return not n % 2
반응형
'나는 이렇게 학습한다 > Algorithm & SQL' 카테고리의 다른 글
1217. Regexp Basics - is it a digit? (0) | 2022.12.17 |
---|---|
1216. Define a card suit (0) | 2022.12.17 |
1214. Find the position! (0) | 2022.12.14 |
1213. Exclamation marks series #1: Remove an exclamation mark from the end of string (0) | 2022.12.13 |
1212. String cleaning (0) | 2022.12.12 |