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 160 views
2 answers 133 views
133 views asked Aug 7, 2022 by avibootz
1 answer 183 views
4 answers 235 views
235 views asked Apr 9, 2021 by avibootz
1 answer 105 views
...