Searching from end of string,searchingstring,string1 = 'T
Searching from end of string,searchingstring,string1 = 'T
string1 = 'Test1, test2, test3, test4, Test5, test6'print 'Index from end of 'test' in '%s' is %d' \ % ( string1, string1.rfind( 'test' ) )print# find rindex of 'Test'try: print 'First occurrence of 'Test' from end at index', \ string1.rindex( 'Test' )except ValueError: print ''Test' does not occur in '%s'' % string1print
- strings can be expressed in several ways.,stringsexpre
- python __getattr__ 示例,python__getattr_,class TT:
- Keyword arguments example.,argumentsexample,def genera
- Default parameter of a function is 'global&#
- Pass string value into a function,passstring,def welco
- Recursive fibonacci function.,recursivefibonacci,def f
热门文章:
相关内容
- strings can be expressed in several ways.,stringsexpressed,print 's
- python __getattr__ 示例,python__getattr_,class TT:
- Keyword arguments example.,argumentsexample,def generate
- Default parameter of a function is 'global',paramet
- Pass string value into a function,passstring,def welcome(
- Recursive fibonacci function.,recursivefibonacci,def fibonacc
- Illustrate parameter passing: tuple, type and tuple,illustratetuple
- Returning Multiple Values from Functions,returningfunctions,def mul
- Demonstrates parameters and return values,,def display(
- dir() Function: find out which names a module defines,namesdefines,
评论关闭