```
*************************
*  Create a frame!      *
*           __     __   *
*          /  \~~~/  \  *
*    ,----(     ..    ) *
*   /      \__     __/  *
*  /|         (\  |(    *
* ^  \  /___\  /\ |     *
*    |__|   |__|-..     *
*************************
```

Given an array of strings and a character to be used as border, output the frame with the content inside.

Notes:

* Always keep a space between the input string and the left and right borders.
* The biggest string inside the array should always fit in the frame.
* The input array is never empty.


## Example

`frame(['Create', 'a', 'frame'], '+')`

Output:
```
++++++++++
+ Create +
+ a      +
+ frame  +
++++++++++
```

Source: codewars | Difficulty: EASY
Tags: String algorithms

Fundamentals

Data structures

Starter code: def frame(text, char):
	

Solutions:
def frame(text, char):
	text_lens = [len(x) for x in text]
	longest_len = max(text_lens)
	frame_list = [char * (longest_len + 4)]
	for str in text:
		frame_list.append('{} {}{} {}'.format(char, str, ' ' * (longest_len - len(str)), char))
	frame_list.append(char * (longest_len + 4))
	return '\n'.join(frame_list)


def frame(text, char):
	n = len(max(text, key=len)) + 4
	return '\n'.join([char * n] + ['%s %s %s' % (char, line.ljust(n - 4), char) for line in text] + [char * n])


def frame(lines, char):
	l = len(max(lines, key=len))
	row = char * (l + 4)
	body = '\n'.join((f'{char} {line:<{l}s} {char}' for line in lines))
	return f'{row}\n{body}\n{row}'


def frame(text, char):
	length = len(max(text, key=len))
	start = end = char * (length + 3)
	k = [' ' + x + ' ' * (length - len(x) + 1) for x in text]
	return (char + '\n' + char).join([start] + k + [end])


from itertools import chain

def frame(words, char):
	size = max(map(len, words))
	frame = [char * (size + 4)]
	middle = (f'{char} {word: <{size}} {char}' for word in words)
	return '\n'.join(chain(frame, middle, frame))


def frame(t, c):
	m = len(max(t, key=len))
	return c * (m + 4) + '\n' + '\n'.join([f'{c} {i:<{m}} {c}' for i in t]) + '\n' + c * (m + 4)


def frame(text, char):
	width = max([len(x) for x in text]) + 4
	a = '\n'.join([char + ' ' + x + ' ' * (width - len(x) - 3) + char for x in text])
	return f'{char * width}\n{a}\n{char * width}'


def frame(text, c):
	mx = max((len(w) for w in text))
	return '\n'.join([c * (mx + 4)] + [c + ' ' + w.ljust(mx) + ' ' + c for w in text] + [c * (mx + 4)])


def frame(text, char):
	max_length = max([len(word) for word in text])
	frame_words = [char + ' ' + word + (max_length - len(word) + 1) * ' ' + char for word in text]
	frame = char * (max_length + 4) + '\n'
	for line in frame_words:
		frame = frame + line + '\n'
	return frame + char * (max_length + 4)


def frame(text, char):
	w = max(map(len, text))

	def f():
		yield (char * (w + 4))
		for line in text:
			yield f'{char} {line:<{w}} {char}'
		yield (char * (w + 4))
	return '\n'.join(f())