Thank you for clerification Christian,<br>when using trailing comma with print statement/function, does it not mean to output newline after printed data?<br><br clear="all">-Alex Goretoy<br><a href="http://www.goretoy.com">http://www.goretoy.com</a><br>
<br>
<br><br><div class="gmail_quote">On Thu, Feb 19, 2009 at 2:54 PM, Christian Heimes <span dir="ltr"><<a href="mailto:lists@cheimes.de">lists@cheimes.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">Carl Schumann wrote:<br>
> I could see the logic in always or never having a trailing comma.   What<br>
> I don't understand here is why only the single element case has a<br>
> trailing comma.   Any explanations please?<br>
<br>
</div>Does this code shad some light on the trailing comma? :)<br>
<br>
>>> (1) == 1<br>
True<br>
>>> (1,) == 1<br>
False<br>
>>> type((1))<br>
<type 'int'><br>
>>> type((1,))<br>
<type 'tuple'><br>
<br>
>>> a = 1<br>
>>> a<br>
1<br>
>>> a = (1)<br>
>>> a<br>
1<br>
>>> a = (1,)<br>
>>> a<br>
(1,)<br>
>>> a = 1,<br>
>>> a<br>
(1,)<br>
<div><div></div><div class="Wj3C7c"><br>
--<br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
</div></div></blockquote></div><br>