I\'m a Python noob and I need some help for a simple problem.
What I need to do is create a list with 3 items and add spaces before and after every item.
For
[ ' {} '.format(x) for x in lst ]
EDIT for python 3.6+:
you can use f-strings instead, see docs: https://www.python.org/dev/peps/pep-0498/
the example above would look like:
[ f' {x} ' for x in lst ]