python string judgment condition

CSDN Q&A 2022-09-09 03:34:12 阅读数:690

pythonstringjudgmentcondition

str = a string
a = str.split('\n')
b = 'Mic3'
for x in a:
if b not in x:
a.remove(x)
print(a)
Why does this code print a string without Mic3

版权声明:本文为[CSDN Q&A]所创,转载请带上原文链接,感谢。 https://pythonmana.com/2022/252/202209021224181069.html