demo_ref_string_expandtabs2.py:
txt = "H\te\tl\tl\to" print(txt) print(txt.expandtabs()) print(txt.expandtabs(2)) print(txt.expandtabs(4)) print(txt.expandtabs(10))
➜ begtut>python demo_string_expandtabs2.py
H e l l o
H e l l o
H e l l o
H e l l o
H e l l o