How string.expandtabs() works?
Hi friends, How expandtabs function of strings works? In [1]: '01\t01\t01\t01'.expandtabs() Out[1]: '01 01 01 01' In [2]: '01\t01\t01\t01'.expandtabs(1) Out[2]: '01 01 01 01' In [3]: '01\t01\t01\t01'.expandtabs(2) # tab size is 2 Out[3]: '01 01 01 01' In [4]: '01\t01\t01\t01'.expandtabs(3) # tab size is 3 Out[4]: '01 01 01 01' In [5]: '01\t012\t012\t012'.expandtabs(3) # tab size is 3 Out[5]: '01 012 012 012' In [6]: '01\t012\t012\t012'.expandtabs(4) # tab size is 3 Out[6]: '01 012 012 012' In [7]: '01\t012\t0123\t0123'.expandtabs(4) # tab size is 4 Out[7]: '01 012 0123 0123' In [8]: '01\t012\t01234\t01234'.expandtabs(4) # tab size is 4 Out[8]: '01 012 01234 01234' In [9]: '01\t012\t01234\t01234'.expandtabs(5) # tab size is 5 Out[9]: '01 012 01234 01234' *regards* *UDHAY PRAKASH*
participants (1)
-
udhay prakash pethakamsetty