In my journeys across the face of the Internet, I found this:
http://p2pu.org/general/python-challenges
Not sure what it's really going to be, but any new programmers/people
looking for something to do might be interested. I'm not quite sure how
a class can be organised around a web riddle, but it
On 2/5/11, bob gailer wrote:
> On 2/5/2011 2:46 PM, Alex Hall wrote:
>> Hi all,
>> I have a class which has a list as an attribute, meaning you must say
>> something like:
>> for result in obj.results: ...
>> I want to make life a bit easier and let users just say:
>> for result in obj: ...
>> Her
On 2/5/2011 2:46 PM, Alex Hall wrote:
Hi all,
I have a class which has a list as an attribute, meaning you must say
something like:
for result in obj.results: ...
I want to make life a bit easier and let users just say:
for result in obj: ...
Here is what I have tried to make my class into an ite
Ben Ganzfried wrote:
Hey,
I'm having a lot of confusion getting the unit test working for one of my
classes for the Roulette bot I'm working on and would greatly appreciate any
advice or help.
[...]
Here is my Bin class:
from Outcome import *
class Bin:
def __init__(self, *outcomes):
Hey,
I'm having a lot of confusion getting the unit test working for one of my
classes for the Roulette bot I'm working on and would greatly appreciate any
advice or help.
Here is the description of what I am trying to do:
http://homepage.mac.com/s_lott/books/oodesign/build-python/html/roulette/b
On 2/5/11, Siim Märtmaa wrote:
> 2011/2/5 Alex Hall :
>> Yes, I get the same thing. However, when you try to index, as in a[0],
>> you have problems. Here are two lines from my program:
>> for i in res: print i
>> This works as expected, printing every object in res.results, just as I
>> wanted.
>
2011/2/5 Alex Hall :
> Yes, I get the same thing. However, when you try to index, as in a[0],
> you have problems. Here are two lines from my program:
> for i in res: print i
> This works as expected, printing every object in res.results, just as I
> wanted.
>
> for i in range(len(res)): print str
On 2/5/11, Peter Otten <__pete...@web.de> wrote:
> Alex Hall wrote:
>
>> Hi all,
>> I have a class which has a list as an attribute, meaning you must say
>> something like:
>> for result in obj.results: ...
>> I want to make life a bit easier and let users just say:
>> for result in obj: ...
>> Her
You should probably read this section in the python tutorial:
http://docs.python.org/tutorial/classes.html#iterators
If you have any questions after that, I would suggest posting back here but
that should cover it.
On Sat, Feb 5, 2011 at 2:46 PM, Alex Hall wrote:
> Hi all,
> I have a class whi
Alex Hall wrote:
> Hi all,
> I have a class which has a list as an attribute, meaning you must say
> something like:
> for result in obj.results: ...
> I want to make life a bit easier and let users just say:
> for result in obj: ...
> Here is what I have tried to make my class into an iterable on
Hi all,
I have a class which has a list as an attribute, meaning you must say
something like:
for result in obj.results: ...
I want to make life a bit easier and let users just say:
for result in obj: ...
Here is what I have tried to make my class into an iterable one, yet I
get an error saying tha
11 matches
Mail list logo