osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Easy way to get a list of tuples.


> >
> >  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

Oh yes I just had one set of brackets with my append.

Thanks

Frank