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 148 views
2 answers 121 views
121 views asked Aug 7, 2022 by avibootz
1 answer 166 views
4 answers 218 views
218 views asked Apr 9, 2021 by avibootz
1 answer 96 views
...