> On Thu, Feb 19, 2009 at 2:54 PM, Christian Heimes <li...@cheimes.de> wrote: >> >> Carl Schumann wrote: >> > I could see the logic in always or never having a trailing comma. What >> > I don't understand here is why only the single element case has a >> > trailing comma. Any explanations please? >> >> Does this code shad some light on the trailing comma? :) >> >> >>> (1) == 1 >> True >> >>> (1,) == 1 >> False >> >>> type((1)) >> <type 'int'> >> >>> type((1,)) >> <type 'tuple'> >> >> >>> a = 1 >> >>> a >> 1 >> >>> a = (1) >> >>> a >> 1 >> >>> a = (1,) >> >>> a >> (1,) >> >>> a = 1, >> >>> a >> (1,) >> On Thu, Feb 19, 2009 at 12:57 PM, alex goretoy <aleksandr.gore...@gmail.com> wrote: > Thank you for clerification Christian, > when using trailing comma with print statement/function, does it not mean to > output newline after printed data? > > -Alex Goretoy > http://www.goretoy.com
Yes it does (it outputs a space instead of a newline), but only with the print-statement, not the print() function. Cheers, Chris -- Follow the path of the Iguana... http://rebertia.com -- http://mail.python.org/mailman/listinfo/python-list