Welcome. In this kata, you are asked to square every digit of a number and concatenate them.

For example, if we run 9119 through the function, 811181 will come out, because 9^(2) is 81 and 1^(2) is 1.

**Note:** The function accepts an integer and returns an integer

Source: codewars | Difficulty: EASY
Tags: Fundamentals

Mathematics

Starter code: def square_digits(num):
	

Solutions:
def square_digits(num):
	ret = ''
	for x in str(num):
		ret += str(int(x) ** 2)
	return int(ret)


def square_digits(num):
	return int(''.join((str(int(d) ** 2) for d in str(num))))


def square_digits(num):
	l = []
	for d in str(num):
		l.append(str(int(d) ** 2))
	return int(''.join(l))


def square_digits(num):
	return int(''.join((str(int(c) ** 2) for c in str(num))))


def square_digits(num):
	num = str(num)
	ans = ''
	for i in num:
		ans += str(int(i) ** 2)
	return int(ans)


def square_digits(num):
	squares = ''
	for x in str(num):
		squares += str(int(x) ** 2)
	return int(squares)


def square_digits(num):
	s = str(num)
	t = len(s)
	y = 0
	g = 0
	b = ''
	while y < t:
		g = int(s[y]) ** 2
		b = b + str(g)
		final = int(b)
		y = y + 1
	return final
	pass


def square_digits(n):
	return int(''.join((str(pow(int(i), 2)) for i in str(n))))


def square_digits(num):
	return int(''.join([str(int(x) ** 2) for x in list(str(num))]))


def square_digits(num):
	return int(''.join([str(n * n) for n in map(int, str(num))]))