1 Star 2 Fork 2

Yonja/python100

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
python62.py 463 Bytes
一键复制 编辑 原始数据 按行查看 历史
zhangweizhi 提交于 9年前 . the 100 theme
#!/usr/bin/python
# -*- coding: UTF-8 -*-
"""
题目:查找字符串。
函数原型:find(str, pos_start, pos_end)
解释:
str:被查找“字串”
pos_start:查找的首字母位置(从0开始计数。默认:0)
pos_end: 查找的末尾位置(默认-1)
返回值:如果查到:返回查找的第一个出现的位置。否则,返回-1。 
"""
sStr1 = 'abcdefg'
sStr2 = 'cde'
sStr3 = 'qq'
print sStr1.find(sStr2)
print sStr1.find(sStr3)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/yonja/python100.git
git@gitee.com:yonja/python100.git
yonja
python100
python100
master

搜索帮助