+ 4
[Solv✌d]Why does output indent from line 2
7 odpowiedzi
+ 9
Simply set :
sep = "\n"
And remove the previous +"\n" before.
+ 5
print puts spaces between the the strings passed as arguments thus print('a', 'b', 'c') outputs 'a b c'. So print(*['foo\n', 'bar']) outputs 'foo\n bar' and the space between does the job of indentation
+ 4
If I get it right so it's a list which you open with the * and each index is separated with a space from the last one except for the first one so it starts only from the second line
+ 4
Perfect! All answers were great thank you all
+ 2
Mahmud Nabil Eliya Ben Baruch what can I do?
+ 2
Default value for sep parameter of print is ' ' just override it to '',
print(........, sep = '')
+ 1
Your welcome