cmp用python3中该怎么写问题中的代码呢
来源:7-12 通过预期结果判断case是否执行成功

qq_灬纸鸢_0
2019-11-05
flag = None
if isinstance(str_one,str):
str_one = str_one.encode('unicode-escape').decode('string_escape')
return operator(str_one,str_two)
if str_one in str_two:
flag = True
else:
flag = False
return flag
这部分代码用python3是怎么实现的呢
现在提示 if str_one in str_two:
flag = True
else:
flag = False
return flag
这部分是不符合规范的语法
写回答
1回答
-
Mushishi
2019-11-05
这里没问题,python3也是一样,就in 或者not in 一个str是否在另外一个str里面
00
相似问题