How can i keep white space in a string?
I have a string
piece = "**\n *\n *"
**
*
*
and I want print this in the center, but it I use this function, doesn't keep the white space
print '\n'.join('{0:^20}'.format(x, 'centered') for x in piece.split('\n'))
**
*
*
I had this output
*
*
**
insert a move w
piece before centring
*
***
*
***
insert a move w
piece before centring
**
*
*
**
*
*
as you can see the second move is right but when I print it on the center something is wrong
in python 3 i am getting this :