Python str.expandtabs() Online
Expand tabs to the next tab stop, as Python str.expandtabs() does.
Run details
The output updates as you type. The tool processes input in your browser.
Worked example
A tab advances to the next tab stop. A line break resets the column used to calculate the following tab.
- Tab size
4
a b c
a b c
Python example
print("a\tb\tc".expandtabs(4))
Expected native output
a b c
Using this operation in Python
The interactive result uses JavaScript. Python str stores Unicode text. Encode to bytes when an API expects UTF-8 or another byte representation.