Here is my code:
(这是我的代码:)
from functools import partial
def x_in_y(word, inner):
return inner in word
wrong = ['mann','connaction','tee','rigt','putt']
sentence=['this mann is my son','the connaction is unstable','my tee is getting cold','put your hands down','rigt now','right behind my back']
for i in wrong:
print(f"Wrong: {i}")
filtered_names = filter(partial(x_in_y, inner=i), sentence)
for name in filtered_names:
print(name)
Please tell me how do i only show the matches without the others?
(请告诉我如何仅显示比赛而不显示其他比赛?)
(In this case, remove "wrong:putt") ((在这种情况下,请删除“ wrong:putt”))
Like:
(喜欢:)
Wrong: mann
this mann is my son
Wrong: connaction
the connaction is unstable
Wrong: tee
my tee is getting cold
Wrong: rigt
rigt now
Please help me.
(请帮我。)
ask by briiipo translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…