[Tutor] string.find is odd

Kalle Svensson kalle@gnupung.net
Wed, 12 Dec 2001 10:31:33 +0100


[Kirk Bailey]

> ok, I want to searh through a list, and return a non negative value
> (='TRUE') if the search object is found.
> The searched list is called 'Members'.
> The search object is a string variable named 'From'.
> arg...

>>> members
['I', 'You', 'He', 'She', 'It', 'We', 'you', 'They']
>>> "It" in members
1
>>> "it" in members
0
>>> "frobitous".find("it") # this is how the .find method works.
4
>>> "frobitous".find("It")
-1

> Good night.

Good morning,
  Kalle
-- 
Kalle Svensson (kalle@gnupung.net) - Laziness, impatience, hubris: Pick two!
English: http://www.gnupung.net/  Svenska: http://www.lysator.liu.se/~kalle/
Stuff: ["http://www.%s.org/" % x for x in "gnu debian python emacs".split()]