你可以使用 in
关键字来判断一个字符串是否包含另一个字符串,例如:
text = "hello world"
if "hello" in text:
print("Text contains the string 'hello'")
else:
print("Text does not contain the string 'hello'")
你可以使用 in
关键字来判断一个字符串是否包含另一个字符串,例如:
text = "hello world"
if "hello" in text:
print("Text contains the string 'hello'")
else:
print("Text does not contain the string 'hello'")