"Ricardo Aráoz" <[EMAIL PROTECTED]> wrote
>> Thanks guys it was really helpful i m just a beginner in
>> python
>> start to program since two days back. So finding little difficulty
>> with
>> some concepts.
>>
>
> Don't worry, I'm a 20 days "old timer". ;c)
And I've been using Python for
Varsha Purohit wrote:
>
> Thanks guys it was really helpful i m just a beginner in python
> start to program since two days back. So finding little difficulty with
> some concepts.
>
Don't worry, I'm a 20 days "old timer". ;c)
___
Tutor maillist
"Ricardo Aráoz" <[EMAIL PROTECTED]> wrote
>>From Python 2.5 documentation :
>
> index( sub[, start[, end]])
> Like find(), but raise ValueError when the substring is not found.
As opposed to find() which returns -1 when the string is
not found. That means you can use try/except with
index but mu
Thanks guys it was really helpful i m just a beginner in python start
to program since two days back. So finding little difficulty with some
concepts.
On 9/2/07, Ricardo Aráoz <[EMAIL PROTECTED]> wrote:
>
> Varsha Purohit wrote:
> > Hello,
> > i have again very basic question in python stri
Varsha Purohit wrote:
> Hello,
> i have again very basic question in python string management.
>
> I am not able to understand how find and index works and what do they
> actually return.
>
line = "this is varsha"
print line.find("is")
> 2
print line.rfind("is")
> 5
print li
Hello,
i have again very basic question in python string management.
I am not able to understand how find and index works and what do they
actually return.
>>> line = "this is varsha"
>>> print line.find("is")
2
>>> print line.rfind("is")
5
>>> print line.rfind("varsha")
8
>>> print line.index(