I looked up the word zoeken -- it means find in English.
I looked up the chapter and exercise in the online text "How to think
like a computer scientist"
Its a good tutorial.
I think the OP seems to get confused on basic concepts.
Here is my stab at the exercise:
#!/usr/bin/env python
"""This
On 2:59 PM, Roelof Wobben wrote:
Hello,
Fine that you are in a arque
But can we come back to my problem.
How can I take care that test2 can be initialized.
Roelof
You had this code, and got the following error:
class zoeken() :
pass
def __len__(self):
return 0
def __st
Hello,
Fine that you are in a arque
But can we come back to my problem.
How can I take care that test2 can be initialized.
Roelof
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscri
On Sun, Sep 26, 2010 at 3:14 AM, Steven D'Aprano wrote:
> On Sun, 26 Sep 2010 02:26:25 pm David Hutto wrote:
>> On Sat, Sep 25, 2010 at 9:16 PM, Steven D'Aprano
> wrote:
>> > On Sun, 26 Sep 2010 08:13:23 am David Hutto wrote:
>> >> Since I had nothing else to do, but practice, this looks much
>>
On Sun, 26 Sep 2010 02:26:25 pm David Hutto wrote:
> On Sat, Sep 25, 2010 at 9:16 PM, Steven D'Aprano
wrote:
> > On Sun, 26 Sep 2010 08:13:23 am David Hutto wrote:
> >> Since I had nothing else to do, but practice, this looks much
> >> better:
> >>
> >> def find(word, search):
> >> if searc
On Sat, Sep 25, 2010 at 9:16 PM, Steven D'Aprano wrote:
> On Sun, 26 Sep 2010 08:13:23 am David Hutto wrote:
>> Since I had nothing else to do, but practice, this looks much better:
>>
>> def find(word, search):
>> if search in word:
>> print True
>> else:
>>
On Sun, 26 Sep 2010 08:13:23 am David Hutto wrote:
> Since I had nothing else to do, but practice, this looks much better:
>
> def find(word, search):
> if search in word:
> print True
> else:
> print False
For some definition of "better".
If I called a fu
On Sun, 26 Sep 2010 04:15:03 am Roelof Wobben wrote:
> Hello,
>
> I have this code:
>
> class zoeken() :
It is traditional to name classes with an initial capital letter, so
Zoeken would be better.
> pass
What is the point of the "pass" statement there? That does nothing. Why
did you put t
Since I had nothing else to do, but practice, this looks much better:
def find(word, search):
if search in word:
print True
else:
print False
word = raw_input('Enter string of letters to search: ' )
search = raw_input('Enter character to find: ')
This is a little better, it returns a if "a" in, or None if using "z":
class zoeken() :
pass
def __len__(self):
return 0
def __str__(self):
return test2
def find(self, strng, ch, start, stop):
index = start
This returns a if "a" in, or -1 if using "z":
class zoeken() :
pass
def __len__(self):
return 0
def __str__(self):
return test2
def find(self, strng, ch, start, stop):
index = start
while index < len(st
Hello,
Still the same errors
Roelof
>
>> Date: Sat, 25 Sep 2010 19:33:52 +0100
>> Subject: Re: [Tutor] class method problem
>> From: andre...@gmail.com
>> To: rwob...@hotmail.com
>>
>> Your method receives 4 argu
Hello,
I have this code:
class zoeken() :
pass
def __len__(self):
return 0
def __str__(self):
return test2
def find(self, strng, ch, start, stop):
index = start
while index < len(strng) and index < stop:
if strng[index] == ch:
13 matches
Mail list logo