欢迎您 本站地址:  
返回首页   返回编程教学  

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例

小库提示 扫描下方二维码,访问手机版。