zl程序教程

您现在的位置是:首页 >  Python

当前栏目

Python 练习实例62

2023-02-18 15:28:45 时间

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例