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