string2 = "Odd or even"# find index of "even"try: print '"even" index is', string2.index( "even" )except ValueError: print '"even" does not occur in "%s"' % string2if string2.startswith( "Odd" ): print '"%s" starts with "Odd"' % string2if string2.endswith( "even" ): print '"%s" ends with "even"n' % string2
Name (required)
email (will not be published) (required)
Website