第一种:
>>> s='nihao,shijie'
>>> t='nihao'
>>> result = t in s
>>> print result
#True
第二种:
import string
deffind_string(s,t):
try:
string.index(s,t)
return True
except(ValueError):
return False
s='nihao,shijie'
t='nihao'
result = find_string(s,t)
print result
#True