Given a number **n**, return the number of positive odd numbers below **n**, EASY!

Expect large Inputs!

Difficulty: EASY
Tags: Mathematics

Starter code:
def odd_count(n):
	

Solutions:
def odd_count(n):
	return len(range(1, n, 2))


def odd_count(n):
	if n < 1:
		return 0
	return int(n / 2)


def odd_count(n):
	return n // 2


import math

def odd_count(n):
	return math.floor(n / 2)


def odd_count(n):
	return n >> 1


odd_count = lambda n: len(range(1, n, 2))


def odd_count(n):
	return int(n >> 1)


def odd_count(n):
	print(n)
	return (n - 1) / 2 if not n % 2 == 0 else n / 2


odd_count = 2 .__rfloordiv__


def odd_count(n):
	count = 0
	if n % 2 == 0:
		count = n - n / 2
	else:
		count = n + 1 - (n + 1) / 2 - 1
	return count


def odd_count(n):
	res = len(list(range(n - 1))) / 2
	if res.is_integer():
		return res
	else:
		return res + 0.5


import math

def odd_count(n):
	if n % 2 != 0:
		return (n - 1) / 2
	else:
		return math.ceil((n - 1) / 2)


def odd_count(n):
	return ((n - 1) / 2, n / 2)[n % 2 == 0]


def odd_count(n):
	result = 0
	temp = n % 2
	if temp == 1:
		return n / 2 - 0.5
	return n / 2


def odd_count(n):
	if n % 2 == 1:
		return n // 2
	else:
		return n / 2


def odd_count(n):
	return n.__divmod__(2)[1 .__invert__()]


import math as m

def odd_count(n):
	pass
	return int(n / 2)


import math

def odd_count(n):
	return math.ceil((n - 1) / 2)


odd_count = lambda n: (n - 1) // 2 + 1 if (n - 1) % 2 != 0 else (n - 1) // 2


def odd_count(n):
	return round(int(n / 2), 0)


def odd_count(n):
	print(n)
	if n % 2:
		return (n + 1) / 2 - 1
	return n / 2


def odd_count(n):
	return int(round(n / 2, 1))


def odd_count(n):
	if n % 2 == 0:
		return n * 0.5
	else:
		return (n - 1) * 0.5


def odd_count(n):
	diff = n / 2
	return int(diff)


def odd_count(n: int) -> int:
	if n % 2 == 0:
		odd_count = n / 2
	else:
		odd_count = n // 2
	return odd_count


def odd_count(n):
	if n % 2 == 0:
		return round(n / 2)
	return round(n - 1) / 2


def odd_count(z):
	return z // 2


def odd_count(n):
	n = round(n)
	if not n % 2:
		return n / 2
	else:
		return (n - 1) / 2


def odd_count(n):
	c = range(1, n, 2)
	for num in c:
		return len(c)


def odd_count(n):
	nums = n // 2
	return nums


def odd_count(n):
	c = 0
	if n % 2 == 0:
		c = n / 2
	else:
		c = n / 2 - 0.5
	return c


def odd_count(n):
	return n // 2
	count_odd = len(count_odd)
	return count_odd


def odd_count(n):
	return n // 2
	oddlist = []
	for eachnumber in range(n - 1, 0, -1):
		if eachnumber % 2 == 0:
			continue
		else:
			oddlist.append(eachnumber)
	return len(oddlist)


def odd_count(n):
	l = list(range(1, n))
	e = l[0:n:2]
	return len(e)


from math import ceil, floor

def odd_count(n):
	return ceil(n / 2) if n % 2 == 0 else floor(n / 2)


def odd_count(n):
	even_list = range(0, n + 1)[0 % 2::2]
	return len(even_list) - 1


def odd_count(n):
	q = n // 2
	return q


def odd_count(n):
	f = n // 2
	return f


def odd_count(n):
	new = n / 2
	return int(new)


import unittest

def odd_count(n):
	return n // 2

class TestOddCount(unittest.TestCase):

	def test_should_return_7_when_given_n_is_15(self):
		n = 15
		actual = odd_count(n)
		self.assertEqual(actual, 7)

	def test_should_return_7511_when_given_n_is_15023(self):
		n = 15023
		actual = odd_count(n)
		self.assertEqual(actual, 7511)


def odd_count(n):
	g = 0
	if n % 2 != 0:
		g = (n - 1) / 2
		g + 1
	else:
		g = n / 2
	return g


def odd_count(a):
	return int(a / 2)


def odd_count(n):
	if not n % 2:
		return int(n / 2)
	else:
		return int((n - 1) / 2)