In Python 3.x how do you print an indent of white space, the method I am looking for looked something like this
level = 3
print ('% indent symbol' % * level, 'indented text')
should print:
indented text
repeating answer from below: thanks to @sudo_coffee for \t
print ('\t' * level, 'indented text')
or maybe:
print ((' ' * 4) * level, 'indented text')
sorry guys, think I found the answer, thanks to @sudo_coffee for \t
print ('\t' * level + 'indented text')
or maybe:
print ((' ' * 4) * level + 'indented text')
level = 3
print (" "*level, 'indented text')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With