Re: [Tutor] Question about lists

2012-09-21 Thread Hugo Arts
On Fri, Sep 21, 2012 at 3:31 PM, Leo Degon wrote: > I'm trying to create a class where the main focus is creating a list whose > elements are lists and the elements of those lists are collection of zeros > and ones. I am trying to create functions to rotate the list ninety > degrees, to reflect i

Re: [Tutor] Question about lists

2012-09-21 Thread Peter Otten
Leo Degon wrote: > I'm trying to create a class where the main focus is creating a list whose > elements are lists and the elements of those lists are collection of zeros > and ones. I am trying to create functions to rotate the list ninety > degrees, to reflect it. Having a few problems with the

Re: [Tutor] Question about lists

2012-09-21 Thread Dave Angel
On 09/21/2012 09:31 AM, Leo Degon wrote: > I'm trying to create a class where the main focus is creating a list whose > elements are lists and the elements of those lists are collection of zeros > and ones. I am trying to create functions to rotate the list ninety > degrees, to reflect it. Having a

[Tutor] Question about lists

2012-09-21 Thread Leo Degon
I'm trying to create a class where the main focus is creating a list whose elements are lists and the elements of those lists are collection of zeros and ones. I am trying to create functions to rotate the list ninety degrees, to reflect it. Having a few problems with the rotation. get TypeError: '

Re: [Tutor] question about lists and doctest

2010-08-26 Thread Nitin Das
The doctest module searches for pieces of text that look like interactive Python sessions, and then executes those sessions to verify that they work exactly as shown. Here ur a_list[3] in docstring is 42 then doctest expects it to be 42 for success. Since u changed 42 to 16 then it is not = 42 as p

[Tutor] question about lists and doctest

2010-08-26 Thread Roelof Wobben
hello, I have this programm # Add your doctests here: """ >>> a_list[3] 42 >>> a_list[6] 'Ni!' >>> len(a_list) 8 """ a_list = ['test', 'test','test',42,'test','test','Ni!','test'] print a_list[3] print a_list[6] print len(a_list) if __name__ == '__main__': import doctes