Re: [Tutor] List of tuples

2016-04-20 Thread Alan Gauld via Tutor
On 19/04/16 21:56, isaac tetteh wrote: > I have a list like this > [ > ("name",2344,34, "boy"),("another",345,47,"boy", "last") > ] Assuming this is list_tuple... > for row in list_tuple: > for row2 in row: > return row This can't work because return needs to be inside a function.

Re: [Tutor] List of tuples

2016-04-20 Thread isaac tetteh
) * (3 - len(rv))ValueError: too many values to unpack > From: d...@hashcollision.org > Date: Tue, 19 Apr 2016 15:01:41 -0700 > Subject: Re: [Tutor] List of tuples > To: itette...@hotmail.com > CC: tutor@python.org > > On Tue, Apr 19, 2016 at 1:56 PM, isaac tetteh &l

Re: [Tutor] List of tuples

2016-04-19 Thread Danny Yoo
Sorry for typos in response: on cell phone at the moment. ;p ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] List of tuples

2016-04-19 Thread Danny Yoo
Okay, in the context of a function, the error you're seeing makes more sense. You need to ensure that the return value of the function is of the right type. In SingleView, the intended return value appears to be a structured response value. Given that, then any other return statements in the

Re: [Tutor] List of tuples

2016-04-19 Thread Danny Yoo
On Tue, Apr 19, 2016 at 1:56 PM, isaac tetteh wrote: > I have a list like this > [ > ("name",2344,34, "boy"),("another",345,47,"boy", "last") > ] > How do u get each value from it like > Output > name > 2344 > 34 > ... > > What i did was > for row in list_tuple: > for

[Tutor] List of tuples

2016-04-19 Thread isaac tetteh
I have a list like this [ ("name",2344,34, "boy"),("another",345,47,"boy", "last") ] How do u get each value from it like Output name 2344 34 ... What i did was for row in list_tuple: for row2 in row: return row But i get error too many value to unpack Please help Sent from