擅长:python、mysql、java
<p>你的代码错了。您需要使用“(引号)来定义变量是字符串。如果不加引号,Python就知道给定的名称是变量,需要返回它们的值。你知道吗</p>
<p>这是正确的代码:</p>
<pre class="lang-py prettyprint-override"><code> new = [ "Behrad", "Mohammad", "Behrad", "Behrad", "Leyla", "Bahman"]
while "Behrad" in new:
new.remove("Behrad")
print(new)
</code></pre>