Python 练习实例62

约 153 字 更新于 2026-11-18 5iyo.com

Python 练习实例62

题目:查找字符串。  

程序分析:无。

程序源代码:


#!/usr/bin/python

# -*- coding: UTF-8 -*-



sStr1 = 'abcdefg'

sStr2 = 'cde'

print sStr1.find(sStr2)

以上实例输出结果为:


2