나는 이렇게 학습한다/Algorithm & SQL

1215. Is it even?

daco2020 2022. 12. 15. 22:52
반응형

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


반응형