Write a function that takes a string and returns an array containing binary numbers equivalent to the ASCII codes of the characters of the string. The binary strings should be eight digits long.

Example: `'man'` should return `[ '01101101', '01100001', '01101110' ]`

Source: codewars | Difficulty: EASY
Tags: Fundamentals

Starter code: def word_to_bin(word):
	

Solutions:
def word_to_bin(word):
	return ['{:08b}'.format(ord(c)) for c in word]


def word_to_bin(word):
	return ['{:0>8b}'.format(ord(c)) for c in word]


def word_to_bin(word):
	return [f'{ord(c):08b}' for c in word]


def word_to_bin(s):
	return [f'{ord(x):08b}' for x in s]


def word_to_bin(s):
	return ['{0:08b}'.format(ord(c)) for c in s]


def word_to_bin(w):
	return [format(ord(c), '08b') for c in w]


def word_to_bin(w):
	return [f'{bin(ord(c))[2:]:0>8}' for c in w]


def word_to_bin(word):
	k = []
	for x in word:
		z = str(bin(ord(x))).replace('0b', '')
		if len(z) < 8:
			z = '0' * (8 - len(z)) + z
			k.append(z)
		else:
			k.append(z)
	return k


def word_to_bin(s):
	return list(map(lambda x: format(ord(x), '08b'), s))