There is a difference between print a, band print (a,b):
>>> a, b = "ab"
>>> a
'a'
>>> b
'b'
>>> print a, b
a b
>>> print (a, b)
('a', 'b')
print a, bprints two objects aand b. print (a, b)prints one tuple object a, b:
>>> w = sys.stdout.write
>>> _ = w(str(a)), w(' '), w(str(b)), w('\n')
a b
>>> _ = w(str((a,b))), w('\n')
('a', 'b')
Or else:
>>> class A:
... def __str__(self):
... return '1'
... def __repr__(self):
... return 'A()'
...
>>> print A(), A()
1 1
>>> print (A(), A())
(A(), A())
__str__ , str(obj). __str__ , __repr__ repr(obj).