0
Can any one help me
Import string Print(string.find("abcdabcdabcdabcdabcd", "cd", 7,13)
1 Answer
+ 2
I will try to help, but im not sure what you need. i will try to provide general information on the subject.
The string module is very outdated, but this is what i found with help(âstringâ):
find(s, *args)
find(s, sub [,start [,end]]) -> in
Return the lowest index in s where substring sub is found,
such that sub is contained within s[start,end]. Optional
arguments start and end are interpreted as in slice notation.
Return -1 on failure.
index(s, *args)
index(s, sub [,start [,end]]) -> int
Like find but raises ValueError when the substring is not found.
Me: Today, find and index are implemented as a built-in methods of the str class, so you could just type âlarryâ.find(âaâ, 0, 3) to search for âaâ in the first 3 letters of the word.
After looking at your code some more, i see you capitalized the print function. this is incorrect, and will generate a simple error âNameError: Name Print is not defined.â