Python Practice Example 62
Problem:Search for a string.
Program analysis:None.
Program source code:
#!/usr/bin/python # -*- coding: UTF-8 -*- sStr1 = 'abcdefg' sStr2 = 'cde' print sStr1.find(sStr2)
The output result of the above example is:
2Other extensions
Python 100 Examples