Puzzling difference between lists and tuples

2QdxY4RzWzUUiLuE at potatochowder.com 2QdxY4RzWzUUiLuE at potatochowder.com
Thu Sep 17 12:41:15 EDT 2020


On 2020-09-17 at 09:24:57 -0600,
William Pearson <william.pearson at gmail.com> wrote:

> for n in ('first'):

That's not a tuple.  That's a string.

Try it this way:

   for n in ('first',): # note the trailing comma
       print n

Dan


More information about the Python-list mailing list