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 262 views
2 answers 235 views
235 views asked Aug 7, 2022 by avibootz
1 answer 276 views
4 answers 383 views
383 views asked Apr 9, 2021 by avibootz
1 answer 192 views
...