判断题 偏易
#16476

运行下列Python代码不会报错。( ) s='good good study' print(s.find('day'))

运行下列Python代码不会报错。( )

s='good good study'
print(s.find('day'))
未登录也能判分,登录后才会记录
答案与解析
正确答案:对
解析

字符串的find()方法查找目标值时,如果在指定字符串中找不到目标值,返回-1,不会抛出异常。