Searching the pattern in a String using find and index

try:
    s="brown box red pencil brown pen red pen red box"
    print s.find("red")
    print s.find("red",13,len(s))
    print s.find("red",34,len(s))
    print s.find("crow")
    print s.index("red")
    print s.index("red",13,len(s))
    print s.index("red",34,len(s))
    print s.index("crow")
except ValueError:
   print "crow not a pattern in string"
   

String operations to remove white spaces

s=" t  ioi ii "
t1=s.rstrip() # removes trailing white space
t2=s.lstrip() # removes leading white space
t3=s.strip()  # removes leading and trailing white space

print s

print t1

print t2

print t3