Tim Chase wrotes:
>> I have a string named text. I need to extract a substring from it
>> starting by variable 's' and ending by 'e'.
>>
>> text[s:e] generates the following error:
>>
>> TypeError: slice indices must be integers or None
>
> Your syntax is correct...the error you get back is th
> I have a string named text. I need to extract a substring from it
> starting by variable 's' and ending by 'e'.
>
> text[s:e] generates the following error:
>
> TypeError: slice indices must be integers or None
Your syntax is correct...the error you get back is the clue:
either "s" or "e
ÁâÐÝØáÛÐÒ ÏÓÛÞ <[EMAIL PROTECTED]> writes:
> text[s:e] generates the following error:
> TypeError: slice indices must be integers or None
>
> How to be? :)
s and e both have to be integers or None. Try printing them out just
before your slice to see if their values are reasonable.
>>> s