expandtabs()

All String methods
my_str.expandtabs(number))
number : optional , number of space to replace tab character.

By default expandtabs() ads 8 space by replacing all tab characters. We can set the number of spaces by giving input parameter.
my_str='a\tbc\tdef\tghij\tklmno'
my_str=my_str.expandtabs()
print(my_str)
Output
a       bc      def     ghij    klmno
my_str='a\tbc\tdef\tghij\tklmno'
my_str=my_str.expandtabs(1)
print(my_str)
Output
a bc def ghij klmno
All String methods


Subscribe to our YouTube Channel here


Subscribe

* indicates required
Subscribe to plus2net

    plus2net.com



    Post your comments , suggestion , error , requirements etc here





    Python Video Tutorials
    Python SQLite Video Tutorials
    Python MySQL Video Tutorials
    Python Tkinter Video Tutorials
    We use cookies to improve your browsing experience. . Learn more
    HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
    ©2000-2024 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer