PyDocs

Nav

Python Runtime Services

str.expandtabs

builtins

method of str
  • str.expandtabs(tabsize=8)
Return a copy where all tab characters are expanded using spaces.

If tabsize is not given, a tab size of 8 characters is assumed.
1 Example
>>> '01\t012\t0123\t01234'.expandtabs()
'01      012     0123    01234'
>>> '01\t012\t0123\t01234'.expandtabs(4)
'01  012 0123    01234'
>>> print('01\t012\n0123\t01234'.expandtabs(4))
01  012
0123    01234
from the Python docs
See Also
No see-alsos for builtins/str.expandtabs
0 Notes
No notes for str.expandtabs