擅长:python、mysql、java
<p><code>name.find("chin")</code>将返回值<code>2</code>,在python中它的布尔值是<code>True</code>。在</p>
<p><code>name.find("Sac")</code>将返回值<code>0</code>,在python中它的布尔值是<code>False</code>。在</p>
<p><code>name.find("sac")</code>将返回值<code>-1</code>,在python中它的布尔值是<code>True</code>。在</p>
<p>使用<code>in</code>运算符,我认为这将为您提供所需的功能。
见下文:</p>
<pre><code>name = "Sachin"
if "chin" in name:
print("Text Presented")
print(name)
if "Sac" in name:
print("Sac is prsented")
print(name)
</code></pre>