How to specify a “tab” in python code? -
this question has reply here:
how write “tab” in python? 3 answerssuppose want write "welcome" tab "username" in file. how can specify tab?
f = open(filename, 'w') f.write("welcome:"+tab+"username");
use \t
character:
>>> print('\tsomething')
in case be
f.write("welcome:\tusername")
python
No comments:
Post a Comment