python学习---搜索字符串中特定字符,返回起始索引
s="I am welcome you!"
world="welcome"
def function():
if world in s:
return s.find(world)
else:
return -1
print(function())
s="I am welcome you!"
world="welcome"
def function():
if world in s:
return s.find(world)
else:
return -1
print(function())