擅长:python、mysql、java
<p>可能是因为您没有考虑大写字母<strong><em>和</em></strong>的字符串。使用<code>str.upper</code>或{<cd2>}可能是解决方案。如果是这样的话,像这样的东西一次就能搞定。在</p>
<pre><code>def is_isogram(txt):
seen = set()
for char in txt.lower():
if char in seen:
return False
seen.add(char)
return True
</code></pre>