String Methods
expandtabs()
Replace tab characters with spaces up to the next tab stop.
str.expandtabs(tabsize=8)
Replace tab characters with spaces up to the next tab stop.
Parameters
| Name | Description |
|---|---|
| tabsize | The number of spaces between tab stops. |
Returns
A new string with tabs expanded.
Try it
Run it and change it
text = "a\tb" print(text.expandtabs(4))