Now you have to write a function that takes an argument and returns the square of it.

Source: codewars | Difficulty: EASY
Tags: Fundamentals

Starter code: def square(n):
	

Solutions:
def square(n):
	return n ** 2


def square(n):
	return n * n


square = lambda n: n * n


def square(n):
	return pow(n, 2)


def square(n):
	return n * n if isinstance(n, int) else None


def mult(a, b):
	mv = 0
	for c in range(b):
		mv = sumVal(mv, a)
	return mv

def sumVal(a, b):
	for c in range(b):
		a = add1(a)
	return a

def add1(a):
	out = ''
	binval = dec2bin(a)
	carry = 0
	convert = True
	while len(binval) > 0:
		if not convert:
			out = binval[-1] + out
		elif carry == 1:
			if binval[-1] == '0':
				convert = False
				carry = 0
				out = '1' + out
			else:
				out = '0' + out
		elif binval[-1] == '0':
			out = '1' + out
			convert = False
		else:
			out = '0' + out
			carry = 1
		binval = binval[:-1]
	if carry == 1:
		out = '1' + out
	return bin2dec(out)

def dec2bin(a):
	if a == 0:
		return '0'
	out = ''
	while a > 0:
		out = str(a % 2) + out
		a = a // 2
	return out

def bin2dec(a):
	out = 0
	while len(a) > 0:
		out *= 2
		out += int(a[0])
		a = a[1:]
	return out

def square(n):
	return mult(n, n)


def square(west_ego):
	power = 9001
	if power > 9000:
		trump = (power - 1) // len('democracy')
		freedom = trump
	kardashian_butt = west_ego
	illuminati = kardashian_butt * west_ego - freedom + trump
	if len('illuminati') == len('confirmed!'):
		return len('ISIS') / 4 * illuminati
	return 'Putin' > 'Obama'


square = lambda n: n ** 2


import math

def square(n):
	return math.pow(float(n), 2)


square = 2 .__rpow__


from numpy import square


square = lambda i: i ** 2


def square(n):
	return sum(map(lambda x: n, range(0, n)))


def square(n):
	c = n * n
	return c


def square(n):
	return eval('n' + '+n' * (n - 1))


def square(n):
	return n.__mul__(n)


def square(n):
	total = n * n
	return total


def square(n):
	b = n * n
	return b


def square(n):
	c = n ** 2
	return c


square = lambda a: a * a


def square(s):
	return s ** 2


def square(num):
	return num ** 2


def square(n):
	squares = int(n ** 2)
	return squares


def square(n):
	return n * n
n = 2
print(n)


def square(n):
	return n * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * 1 * n


def square(n):
	p = n
	l = n * p
	return l


import math

def square(n):
	num = n ** 2
	return num


def square(n):
	powerful_n = n ** 2
	return powerful_n


def square(n):
	res = 0
	for i in range(n):
		res += n
	return res


def square(n):
	result = ''
	if True:
		result = n ** 2
	return result


def square(n):
	c = 0
	v = 0
	while c < n:
		v += n
		c += 1
	return v


def square(n):
	y = n ** 2
	return y


square = lambda i: i * i


square = lambda s: s ** 2


def square(n):
	m = 0
	while m != n * n:
		m += 1
	return m


import math

def square(n):
	return int(math.pow(n, 2))


def square(n):
	x = int(n) * int(n)
	return x


from scipy.integrate import quad as integrate

def square(n):
	return sum(set([round(value, 5) for value in (n ** 2, n * n, (lambda x: x ** 2)(n), (lambda x: x * x)(n), (lambda x: integrate(lambda a, b: b, min(0, n), max(0, n), args=n))(n)[0], sum((n for _ in range(int(n)))) + n * (n - n // 1 + 0 if n >= 0 else 1))]))


def square(n):
	m = n * n
	return m


def square(n):
	return int(n) * int(n)


def square(n):
	s = n * n
	return s
k = 5
square(k)
pass


square = lambda l: l * l


def square(n):
	product = 1
	product = n * n
	return product


def square(n):
	return sum((n for i in range(n)))


def square(n):
	pass
	s = pow(n, 2)
	return s


def square(n):
	res = n * n
	return res


def square(n):
	a = n ** 2
	return a


def square(n):
	squared = n * n
	return squared


def square(n):
	answer = n * n
	return answer


def square(n):
	s = n * n
	return s


def square(n):
	ans = 0
	for i in range(n):
		for j in range(n):
			ans += 1
	return ans


def square(n):
	i = n * n
	return i
	pass


def square(n):
	result = n ** 2
	return result


def square(n):
	a = n * n
	return a


import math

def square(n):
	return n ** math.sqrt(4)


def square(n):
	return n * sum([1 for x in range(0, n)])


import math

def __pow(a, b=2):
	return pow(a, b)
math.pow = __pow
square = math.pow


square = lambda n: pow(n, 2)


square = lambda a: a ** 2


def square(n):
	return abs(n * n)


def square(n, y=2):
	if y == 1:
		return n
	else:
		return n * square(n, y - 1)


def square(n):
	sqr = n ** 2
	return sqr


import math

def square(n):
	return n * n


def square(n):
	sq = n ** 2
	return sq
	pass


def square(n):
	if type(n) == int or type(n) == float:
		return n ** 2
	else:
		return False


square = lambda x: x ** 2


def square(n):
	ans = n ** 2
	return ans


square = lambda x: x * x


def square(n):
	return float(n) * n


from math import pow

def square(n):
	return pow(n, 2)