擅长:python、mysql、java
<p>您的代码只检查第一个字母(在示例'h'中),然后已经返回。只应在运行整个for循环后返回:</p>
<pre><code>def isogram(aWord):
if aWord == '':
return (aWord, False)
elif type(aWord) != str:
raise TypeError('Argument should be a string')
else:
for letter in aWord:
if aWord.count(letter) > 1:
return (aWord, False)
return (aWord, True)
</code></pre>