tags:
- code
topic: Modulus
difficulty: Easy
link: https://www.codewars.com/kata/555086d53eac039a2a000083/python
date: 2023-12-30
Problem
Write a function that will take two numbers and return True if one is even, and the other is odd.
def lovefunc( flower1, flower2 ):
# ...
return True if flower1 % 2 == 0 and flower2 % 2 == 1 or flower1 % 2 == 1 and flower2 % 2 == 0 else False
def lovefunc(flower1, flower2):
return flower1 % 2 != flower2 % 2
def lovefunc( flower1, flower2 ):
return (flower1+flower2)%2