How to set the tab size of a string in Python

1 Answer

0 votes
s = "Python\tPHP\tJAVA"

st = s.expandtabs(3)

print(st)


'''
run:

Python   PHP   JAVA

'''

 



answered Dec 20, 2018 by avibootz

Related questions

1 answer 264 views
2 answers 240 views
240 views asked Aug 7, 2022 by avibootz
1 answer 278 views
4 answers 387 views
387 views asked Apr 9, 2021 by avibootz
1 answer 195 views
...