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 are considered UNeven for this kata.

Source: codewars | Difficulty: EASY
Tags: Fundamentals

Starter code: def is_even(n):
	

Solutions:
def is_even(n):
	return n % 2 == 0


def is_even(n):
	if n % 2 == 1:
		return False
	elif n % 2 == 0:
		return True
	elif n != int:
		return False


is_even = lambda n: n % 2 == 0


def is_even(n):
	return isinstance(n, int) and n % 2 == 0


def is_even(n):
	output = False
	if n % 2 == 0:
		output = True
	return output


def is_even(n):
	return type(n) != float and n % 2 == 0


def is_even(n):
	if n % 2 == 0:
		return True
	else:
		return False


def is_even(n):
	if n % 2 == 0:
		return True
	elif n % 2 != 0:
		return False


def is_even(number):
	if isinstance(number, float):
		even = False
	else:
		result = number % 2
		even = not result
	return even


def is_even(n):
	if isinstance(n, float):
		return False
	else:
		return not n % 2


def is_even(n):
	if type(n) == float:
		return False
	if n % 2 == 0:
		return True
	return False


def is_even(n):
	return n % 2 == 0 if type(n) == int else False


def is_even(n):
	if type(n) != int:
		return False
	elif n % 2 == 1:
		return False
	else:
		return True


def is_even(n):
	return True if n % 2 == 0 and type(n) != float else False


def is_even(n):
	return False if type(n) == float else n & 1 == 0


def is_even(n):
	return True if n // 1 == n and n % 2 - 1 else False


def is_even(n):
	return True if (n / 2).is_integer() else False


is_even = lambda n: not n % 2


def is_even(n):
	return not n % 2


def is_even(n):
	if isinstance(n, int):
		if n % 2 == 0:
			return True
	return False


def is_even(n):
	if n % 1 != 0:
		return False
	elif n % 2 == 0:
		return True
	else:
		return False


def is_even(x):
	if x % 2 == 0:
		return True
	else:
		return False


def is_even(n: int) -> bool:
	return not n % 2


def is_even(n):
	try:
		return bin(n)[-1] == '0'
	except TypeError:
		return False


def is_even(n):
	return type(n) == int and (n + 1) % 2


def is_even(n):
	return n % 2 == 0 if n is not type(float) else False


def is_even(n):
	flag = False
	if not n % 2:
		flag = True
	return flag


def is_even(n):
	return n % 2 == False


def is_even(n):
	return type(n) == int and (not n & 1)


def is_even(n):
	return n // 2 * 2 == n


def is_even(n):
	if n == float:
		return False
	elif n % 2 == 0:
		return True
	elif n % 2 != 0:
		return False
print(is_even(32))


def is_even(n):
	return not n & 1 if type(n) == int else False


import unittest

def is_even(n):
	return n % 2 == 0

class TestIsEven(unittest.TestCase):

	def test_is_even_with_even(self):
		self.assertTrue(is_even(4))

	def test_is_even_with_odd(self):
		self.assertFalse(is_even(5))


def is_even(n):
	if isinstance(n, int) is True:
		if n % 2 == 0:
			return True
		else:
			return False
	else:
		return False


def is_even(n):
	a = abs(n)
	if a % 2 == 0:
		return True
	else:
		return False


def is_even(n):
	return type(n) is int and (not n % 2)


def is_even(n):
	return n % 2 == 0 or False


def is_even(n):
	if n % 2 == 0 and (not isinstance(n, float)):
		return True
	else:
		return False


def is_even(n):
	if n % 2 == 0:
		return n == n
	else:
		return n != n


def is_even(n):
	return n % 2 == 0 or type(n) == type(float)


def is_even(n):
	if n is float:
		return False
	elif n % 2 == 0:
		return True
	else:
		return False
	pass


def is_even(n):
	a = n / 2
	if a == int(a):
		return True
	else:
		return False


def is_even(n):
	if isinstance(n, float):
		return False
	if n % 2 != 0:
		return False
	return True
	pass


def is_even(n):
	return float(int(n % 2 == 0))


def is_even(n):
	if n % 2 == 0:
		return True
	elif n % 2 == 1 or n == float(n):
		return False


def is_even(n):
	bool = False
	if n % 2 == 0:
		bool = True
	return bool


def is_even(n):
	gg = int(n)
	if len(str(n)) == len(str(gg)):
		if n % 2 == 0:
			return True
	return False


def is_even(n):
	n = abs(n)
	if isinstance(n, float) or n % 2 == 1:
		return False
	else:
		return True


def is_even(n):
	while n > 0 or n < 0:
		if n % 2 == 0:
			return True
		else:
			return False
	if n == 0:
		return True


def is_even(n):
	return 1 if abs(n) % 2 == 0 else 0


def is_even(n):
	return not n % 2 if not n % 1 else False


def is_even(n):
	a = n % 2
	if a == 0:
		return True
	return False
	pass


def is_even(n):
	result = True
	if type(n) == float or n % 2 != 0:
		result = False
	return result


def is_even(n: int) -> bool:
	return n % 2 == 0


def is_even(n):
	if type(n) == float:
		return False
	if type(n) == int:
		if n % 2 == 0:
			return True
		if n % 2 == 1:
			return False


def is_even(n):
	return not n % 2 if isinstance(n, int) else False


def is_even(n):
	return False if type(n) == float else not abs(n) % 2


def is_even(n):
	return n % 1 == 0 and n % 2 == 0


def is_even(n):
	return True if type(n) is int and n % 2 == 0 else False


is_even = lambda n: n % 2 == 0 and isinstance(n, int) or 0


def is_even(n):
	results = False
	if n % 2 == 0:
		results = True
	return results


def is_even(num):
	return num % 2 == 0


def is_even(n):
	return False if type(n) == float else n % 2 == 0


def is_even(n):
	torf = False
	if n % 2 == 0:
		torf = True
		return torf
	else:
		return torf
	pass


def is_even(n):
	if type(n) == int:
		if n % 2 == 0:
			t_f = True
		else:
			t_f = False
	else:
		t_f = False
	return t_f