[Tutor] newbie question 2

Deirdre Saoirse deirdre@deirdre.net
Tue, 16 Nov 1999 14:27:13 -0800 (PST)


On Tue, 16 Nov 1999, Kevin Liang wrote:

> def numwords(s):
>     list = string.split(s)
>     return len(list)
> 
> What does the (s) mean ?  Thanks..

It's a parameter passed in. In this case, it's a string variable with the
name s.

the next line splits it by white space and the following line counts the
number of pieces.

> Also, I was thinking of getting the book Learning Python , the
> one by O'Reily et al , and has the big rat/mouse on the
> cover..anyone recommend it ?  It had a good review in linux
> journal

Given that there's no other beginner book, it is useful.

-- 
_Deirdre   *   http://www.linuxcabal.net   *   http://www.deirdre.net
"Mars has been a tough target" -- Peter G. Neumann, Risks Digest Moderator
"That's because the Martians keep shooting things down." -- Harlan Rosenthal
<Harlan.Rosenthal@Dialogic.com>, retorting in Risks Digest 20.60