一个例子看懂:

s = "I am a beautiful girl"
if s.find("beautiful") == -1:
    print("beautiful is not in the string")
else:
    print("beautiful is in the string")
0
Posted in Python

Leave a Comment:

电子邮件地址不会被公开。