Latest web development tutorials

Python includes exercises 62

Python 100 Li Python 100 Li

Title: search string.

Program Analysis: None.

Source Code:

#!/usr/bin/python
# -*- coding: UTF-8 -*-

sStr1 = 'abcdefg'
sStr2 = 'cde'
print sStr1.find(sStr2)

The above example output is:

2

Python 100 Li Python 100 Li