Make me a square!
Carrot, 11 bytes
###
# #
###
Try it online!
The program is in caret-mode, where #
s are replaced with the input.
Charcoal, 5 3 bytes
B³S
Try it online! Edit: Saved 40% thanks to @carusocomputing. Explanation:
B Draw a box
³ 3×3 (second dimension is implicit if omitted)
S Using the input character
Python 2, 32 bytes
lambda s:s+s.join(s+'\n \n'+s)+s
Try it online!
For s='a'
: the middle s+'\n \n'+s
generates a\n \na
and s.join
turns it in aa\na a\naa
(bold a
s are the ones that .join
adds), because .join
accepts a string as an iterable, then it is surrounded with the two missing characters