TUTORIALProgrammingFETCHED

Python 练习实例62

Python 练习实例62 Python 100例 题目:查找字符串。 程序分析:无。 程序源代码: #!/usr/bin/python # -*- coding: UTF-8 -*- sStr1 = 'abcdefg' sStr2 = 'cde' print sStr1.find(sStr2) 以上实例输出结果为: 2 Python 100例..

Updated 7/16/2026

Tutorial detail pages default to noindex.

Python 练习实例62

Python 100例 Python 100例

题目:查找字符串。  

程序分析:无。

程序源代码:

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

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

以上实例输出结果为:

2

Python 100例 Python 100例