【发布时间】:2014-09-02 17:29:47
【问题描述】:
当我尝试在我的程序中使用它时,它说有一个属性错误
'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
【问题讨论】:
标签: python string attributeerror