[Tutor] checking for substrings
reavey
reavey@nep.net
Mon Dec 16 20:59:01 2002
--------------080306020703070007060506
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Sirs:
I'm confused?
>>>"the rain in spain falls mainly on the plain"
>>> "falls " in "the rain in spain falls mainly on the plain"
1
#"in" looks like a yes or no test.#
>>>a = "the rain in spain falls mainly on the plain"
>>> "falls" in a.split()
1
>>>print a.find("falls")
18
>>>a.find("falls")
18
>>>b = "the rain in spain falls mainly on the plain in june"
Is there a way to use find to "see" the second "in" in the above example?
A reverse find?
TIA
Re-v ?
--------------080306020703070007060506
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title></title>
</head>
<body>
Sirs:<br>
<br>
I'm confused?<br>
>>>"the rain in spain falls mainly on the plain"<br>
>>> "falls " in "the rain in spain falls mainly on the plain"<br>
1<br>
#"in" looks like a yes or no test.#<br>
>>>a = "the rain in spain falls mainly on the plain"<br>
>>> "falls" in a.split()<br>
1<br>
>>>print a.find("falls")<br>
18<br>
>>>a.find("falls")<br>
18<br>
>>>b = "the rain in spain falls mainly on the plain in june"<br>
Is there a way to use find to "see" the second "in" in the above example?<br>
A reverse find?<br>
TIA<br>
Re-v <i>못</i><br>
<br>
<br>
</body>
</html>
--------------080306020703070007060506--