Re: [Tutor] Returning multiple objects from a function

2012-07-03 Thread Steven D'Aprano
On Tue, Jul 03, 2012 at 07:45:53PM -0700, Alexander Q. wrote: > -Alex > > P.S. Let me know if this message is sent incorrectly (I scrolled down to > the bottom of the text box to type this, as opposed to writing the message > at the top of the text box. I am guessing this is what is meant by > "t

Re: [Tutor] Returning multiple objects from a function

2012-07-03 Thread Alexander Q.
On Mon, Jul 2, 2012 at 8:56 PM, Dave Angel wrote: > On 07/02/2012 10:23 PM, Alexander Q. wrote: > > I understand the basics of tuples, but that formulation returned the > > following error: > > > > Traceback (most recent call last): > > File "C:\Users\Owner\Desktop\MIT\Sets\Set3.py", line 34, i

Re: [Tutor] Returning multiple objects from a function

2012-07-03 Thread Walter Prins
Hi On 3 July 2012 03:23, Alexander Q. wrote: > > Traceback (most recent call last): > File "C:\Users\Owner\Desktop\MIT\Sets\Set3.py", line 34, in > list4 = tuplesresult[1] > TypeError: 'NoneType' object is not subscriptable Ok as a bit of clarification: When you have a function that doesn

Re: [Tutor] Returning multiple objects from a function

2012-07-02 Thread Dave Angel
On 07/02/2012 10:23 PM, Alexander Q. wrote: > I understand the basics of tuples, but that formulation returned the > following error: > > Traceback (most recent call last): > File "C:\Users\Owner\Desktop\MIT\Sets\Set3.py", line 34, in > list4 = tuplesresult[1] > TypeError: 'NoneType' object

Re: [Tutor] Returning multiple objects from a function

2012-07-02 Thread Alexander Q.
I understand the basics of tuples, but that formulation returned the following error: Traceback (most recent call last): File "C:\Users\Owner\Desktop\MIT\Sets\Set3.py", line 34, in list4 = tuplesresult[1] TypeError: 'NoneType' object is not subscriptable When I tried to assign "tuplesresul

Re: [Tutor] Returning multiple objects from a function

2012-07-02 Thread Alan Gauld
On 02/07/12 23:55, Alexander Q. wrote: For example, if I have "return(list1, list2, list 3)" within a function "mainFunc()" that takes no arguments, how do I use list1, list2, and list3 outside of the function Just assign the result to 3 variables: L1,L2,L3 = mainFunc() This is just a specia

Re: [Tutor] Returning multiple objects from a function

2012-07-02 Thread Walter Prins
On 2 July 2012 23:55, Alexander Q. wrote: > Hello- I'm wondering how to access specific objects returned from a function > when that function returns multiple objects. > > For example, if I have "return(list1, list2, list 3)" within a function When you have: return (list1, list2, list3) ... you'