'adb'.startwith('a')提示错误:AttributeError: 'str' object has no attribute 'startwith'
但是写成:
str = 'adb'
str.startwith('a')
成功运行,返回True
十分不解。求解
'adb'.startwith('a')提示错误:AttributeError: 'str' object has no attribute 'startwith'
但是写成:
str = 'adb'
str.startwith('a')
成功运行,返回True
十分不解。求解
你好,是你的函数名写错了
函数为startswith(),你的函数少了个s
试一下吧