Timmy & Sarah think they are in love, but around where they live, they will only know once they pick a flower each. If one of the flowers has an even number of petals and the other has an odd number of petals it means they are in love. 

Write a function that will take the number of petals of each flower and return true if they are in love and false if they aren't.

Difficulty: EASY
Tags: Fundamentals

Starter code:
def lovefunc( flower1, flower2 ):
	

Solutions:
def lovefunc(flower1, flower2):
	return (flower1 + flower2) % 2


def lovefunc(a, b):
	if a % 2 == 0 and b % 2 == 0:
		return False
	elif a % 2 != 0 and b % 2 == 0:
		return True
	elif a % 2 == 0 and b % 2 != 0:
		return True
	else:
		return False


lovefunc = lambda a, b: (a + b) % 2


def lovefunc(f1, f2):
	return True if f1 % 2 == 0 and f2 % 2 != 0 or (f2 % 2 == 0 and f1 % 2 != 0) else False


def lovefunc(flower1, flower2):
	if all([isinstance(i, int) for i in [flower1, flower2]]):
		return not (flower1 + flower2) % 2 == 0
	else:
		print('both of the numbers must be integers!')


def lovefunc(flower1, flower2):
	if flower1 % 2 == 0 and flower2 % 2 or (flower1 % 2 and flower2 % 2 == 0):
		return True
	else:
		return False


def lovefunc(flower1, flower2):
	if flower1 % 2 != flower2 % 2:
		return True
	else:
		return False


def lovefunc(a, b):
	return a % 2 ^ b % 2


def lovefunc(flower1, flower2):
	return (flower1 ^ flower2) & 1 == 1


lovefunc = lambda f, s: (f + s) % 2


lovefunc = lambda a, b: bool((a + b) % 2)


def lovefunc(*arg):
	return sum(arg) % 2


lovefunc = lambda a, b: (a ^ b) & 1


from typing import Tuple

def lovefunc(*flowers: Tuple[int]) -> bool:
	return len(list(filter(lambda _it: _it % 2, flowers))) == 1


lovefunc = lambda x, y: x & 1 ^ y & 1


def lovefunc(seq, elem):
	return seq % 2 == 0 and elem % 2 != 0 or (seq % 2 != 0 and elem % 2 == 0)


lovefunc = lambda x, y: x % 2 != y % 2


def lovefunc(flower1, flower2):
	even_odd = []
	if flower1 % 2 == 0:
		even_odd.append('even')
	else:
		even_odd.append('odd')
	if flower2 % 2 == 0:
		even_odd.append('even')
	else:
		even_odd.append('odd')
	return even_odd.count('odd') == 1


def lovefunc(flower1, flower2):
	a = lambda x, y: True if x % 2 == 0 and y % 2 == 1 or (x % 2 == 1 and y % 2 == 0) else False
	return a(flower1, flower2)


def lovefunc(f, f1):
	if f % 2 == 0 and f1 % 2 != 0:
		return True
	return True if f % 2 != 0 and f1 % 2 == 0 else False


def lovefunc(flower1, flower2):
	if flower1 % 2 == 1 and flower2 % 2 == 1:
		return False
	elif flower1 % 2 == 0 and flower2 % 2 == 0:
		return False
	else:
		return True


def lovefunc(flower1, flower2):
	x = flower1 % 2
	y = flower2 % 2
	return True if x + y == 1 else False


def lovefunc(flower1, flower2):
	return flower1 % 2 != 0 and flower2 % 2 == 0 or (flower2 % 2 != 0 and flower1 % 2 == 0)


def lovefunc(flower1, flower2):
	petal1 = flower1 % 2
	petal2 = flower2 % 2
	if petal1 == 0 and petal2 > 0:
		return True
	if petal1 > 0 and petal2 == 0:
		return True
	if petal1 == 0 and petal2 == 0:
		return False
	if petal1 > 0 and petal2 > 0:
		return False


def lovefunc(flower1, flower2):

	def even(x):
		return x % 2 == 0
	a = even(flower1)
	b = even(flower2)
	return a and (not b) or (b and (not a))


def lovefunc(f1, f2):
	return not (f1 % 2 == 0 and f2 % 2 == 0 or (f1 % 2 != 0 and f2 % 2 != 0))


def lovefunc(flower1, flower2):
	flower_1 = flower1 / 2
	flower_2 = flower2 / 2
	if flower1 == flower2:
		return False
	elif flower_1 + flower_2 == int(flower_1 + flower_2):
		return False
	else:
		return True


def lovefunc(f1, f2):
	return (f1 % 2 + f2 % 2) % 2 == 1


def lovefunc(f1, f2):
	return True if abs(f1 - f2) % 2 == 1 else False


def lovefunc(flower1, flower2):
	count1 = 0
	count2 = 0
	for i in range(flower1):
		count1 += 1
	for j in range(flower2):
		count2 += 1
	if count1 % 2 == 1 and count2 % 2 == 0 or (count1 % 2 == 0 and count2 % 2 == 1):
		return True
	else:
		return False


def lovefunc(f1, f2):
	return abs(f1 - f2) % 2 != 0


def lovefunc(flower1, flower2):
	print(flower1, flower2)
	if flower1 % 2 == 0 and flower2 % 2 != 0:
		return True
	if flower1 % 2 != 0 and flower2 % 2 == 0:
		return True
	return False


def lovefunc(flower1, flower2):
	return all([any([flower1 % 2 == 0, flower2 % 2 == 0]), any([flower1 % 2 == 1, flower2 % 2 == 1])])


def lovefunc(flower1, flower2):
	remainder1 = flower1 % 2
	remainder2 = flower2 % 2
	if remainder1 != remainder2:
		return True
	else:
		return False


def lovefunc(flower1, flower2):
	odd = False
	even = False
	if flower1 % 2 == 0:
		even = True
	elif flower1 % 2 != 0:
		odd = True
	if flower2 % 2 == 0:
		even = True
	elif flower2 % 2 != 0:
		odd = True
	if odd is True and even is True:
		return True
	return False


def lovefunc(flower1, flower2):
	if abs(flower1 - flower2) % 2 != 0:
		return True
	return False


def lovefunc(x, s):
	return x % 2 != s % 2


def lovefunc(flower1, flower2):
	odd1 = flower1 % 2
	odd2 = flower2 % 2
	if (odd1 or odd2) and (not (odd1 and odd2)):
		return True
	else:
		return False


def lovefunc(flower1, flower2):
	return bool(flower1 % 2 and (not flower2 % 2) or (flower2 % 2 and (not flower1 % 2)))


def lovefunc(f1, f2):
	i = f1 + f2
	if i % 2 == 0:
		return False
	else:
		return True


def lovefunc(flower1, flower2):
	if flower1 % 2 and (not flower2 % 2):
		return True
	elif not flower1 % 2 and flower2 % 2:
		return True
	return False


def lovefunc(flower1, flower2):
	if (flower1 + flower2) % 2 != 0:
		return True
	elif (flower1 + flower2) % 2 == 0 or flower1 + flower2 == 0:
		return False


def lovefunc(flower1, flower2):
	f1 = int(flower1)
	f2 = int(flower2)
	if f1 % 2 == 0 and f2 % 2 == 0:
		return False
	elif f1 % 2 != 0 and f2 % 2 != 0:
		return False
	else:
		return True


def lovefunc(flowers1, flowers2):
	return (flowers1 + flowers2) % 2 != 0


def lovefunc(f1, f2):
	return sum([f1, f2]) % 2


def lovefunc(flower1, flower2):
	return (flower1 + flower2) % 2 == 1 if flower1 + flower2 != 0 else False


lovefunc = lambda flower1, flower2: (flower1 + flower2) % 2


lovefunc = lambda flower1, flower2: not flower1 % 2 ^ (not flower2 % 2)


def lovefunc(f, ff):
	return True if (f + ff) % 2 == 1 else False


def lovefunc(flower1, flower2):
	if flower1 % 2 == 0:
		return not flower2 % 2 == 0
	else:
		return flower2 % 2 == 0


def lovefunc(*a):
	return sum(a) % 2


def lovefunc(flower1, flower2):
	return True in [i % 2 != 0 for i in [flower1, flower2]]