3
當我嘗試在我的程序來使用這個,它說,有一個屬性錯誤AttributeError的:「builtin_function_or_method」對象有沒有屬性「取代」
'builtin_function_or_method' object has no attribute 'replace'
,但我不明白爲什麼。
def verify_anagrams(first, second):
first=first.lower
second=second.lower
first=first.replace(' ','')
second=second.replace(' ','')
a='abcdefghijklmnopqrstuvwxyz'
b=len(first)
e=0
for i in a:
c=first.count(i)
d=second.count(i)
if c==d:
e+=1
return b==e
謝謝你這麼多,我沒有看到正確的地方! – 1089