+ 5
[SOLVED]What's the difference between sep and end?
What's the difference between sep and end in python, and when should they be used?
5 Antworten
+ 9
used like this
print(1,2,3,sep="quot;)
>>> 1$2$3
print(1,2,3,end="quot;)
>>> 1 2 3$
print(1,2,3,end="quot;)
print(1,2,3,end="quot;)
>>> 1 2 3$1 2 3$
+ 3
LONGTIE edited
+ 3
Abdur's answer apparently disappeared so here's my answer:
sep is the separator between any 2 things. end is the one that comes after the last thing has been printed.
+ 2
Abdur-Rahmaan Janhangeer
why dose the last line not end with $?
+ 2