Python的一些基础方法

  • 判断字符串中是否包含子字符串,可以使用in操作符:
root = "The Long Goodbye."
if  "bye" not in root :
    print("root contains 'bye'.")

你可能感兴趣的:(Python的一些基础方法)