<p>我需要检查子字符串是否是特定字符串的一部分。子字符串是“AAA”,如果在给定字符串中找到它,它必须返回True。如果它不在字符串中,则必须返回False</p>
<pre><code>def isResistent(virus):
gen = "AAA"
if gen in virus:
print("True")
else:
print("False")
isResistent('GCAAGCTGGTCGTGAAAGCT')
</code></pre>
<p>它返回True或False,但除了True或False之外,它首先给出索引号或其他内容。当我多次运行该程序时,它返回:</p>
<p><strong>输出:</strong></p>
^{pr2}$
<p>有可能只打印真假吗?在</p>