728x90
반응형
https://www.codewars.com/kata/555a67db74814aa4ee0001b5/train/python
더보기
내 코드
# My Code
def is_even(n):
return (True if abs(n)%2 == 0 else False)
if __name__=='__main__':
answer = is_even(0)
print(answer)
answer = is_even(0.5)
print(answer)
answer = is_even(-4)
print(answer)
answer = is_even(15)
print(answer)
|
반응형
'알고리즘 > 코드워' 카테고리의 다른 글
[python]What's a Perfect Power anyway? (0) | 2020.04.03 |
---|---|
[python]Beginner Series#1 School Paperwork (0) | 2020.04.01 |
[python]Find the first non-consecutive number (0) | 2020.03.28 |
[python]Find the Difference in Age between Oldest and Youngest Family Members (0) | 2020.03.27 |
[python]All Star Code Challenge#18 (0) | 2020.03.26 |