Easy way to get a list of tuples.

Frank Millman frank at chagford.com
Thu Sep 21 07:44:36 EDT 2017


"Sayth Renshaw"  wrote in message 
news:cd4aa5c7-47ee-442b-945e-490b0674e8cd at googlegroups.com...
>
>  Thanks Thomas yes you are right with append. I have tried it but just 
> can't get it yet as append takes only 1 argument and I wish to give it 3.
>
You have not showed us what you tried, but you are probably missing a pair 
of brackets.

C:\Users\User>python
Python 3.6.0 (v3.6.0:41df79263a11, Dec 23 2016, 08:06:12) [MSC v.1900 64 bit 
(AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> x = []
>>> x.append(('a', 'b', 'c'))
>>> x.append(('p', 'q', 'r'))
>>> x
[('a', 'b', 'c'), ('p', 'q', 'r')]
>>>

Does this help?

Frank Millman






More information about the Python-list mailing list