Python: Writing text with a width seperator? -
i looks this:
-----hello------
now know can symbols print defining , printing width, how insert text within it? thanks.
you should try this:
print 'hello'.center(16,'-')
or this:
print '{:-^16}'.format("hello")
that set width 16
, pad string '-'
.
check tutorial here.
Comments
Post a Comment