我正在寻找Python中的一个string.contains或string.indexof方法.
我想要做:
if not somestring.contains("blah"):
continue
Run Code Online (Sandbox Code Playgroud) 我正在迭代Python中的元组列表,并且如果它们符合某些条件,我会尝试删除它们.
for tup in somelist:
if determine(tup):
code_to_remove_tup
Run Code Online (Sandbox Code Playgroud)
我应该用什么代替code_to_remove_tup?我无法弄清楚如何以这种方式删除项目.