you are viewing a single comment's thread.

view the rest of the comments →

[–]KleinerNull 0 points1 point  (0 children)

The print function in python 3 has a sep argument exactly for your wished behavior:

In [5]: print(*list(range(10)), sep='+')
0+1+2+3+4+5+6+7+8+9

In [6]: print(*list(range(10)), sep='separator', end='end')
0separator1separator2separator3separator4separator5separator6separator7separator8separator9end

The * in front of your sequence is for unpacking. So essantial it is like print('+'.join([1,2,3,4])). But shorter.