python的string对象没有contains方法,不用使用string.contains的方法判断是否包含子字符串,但是python有更简单的方法来替换contains函数
方法1:使用 in 方法实现contains的功能:
方法2:使用find函数实现contains的功能