<p>为什么我得到一个错误内置函数函数或方法对象是不可下标的,我怎样才能使一个字符串成为一个列表,以便我可以索引到字符串?你知道吗</p>
<pre><code>s = input("Please enter a word: ")
s = s.lower
Pal = True
def recpal(s):
if Pal == False:
return(False)
else:
return(True)
def main():
y = recpal(s)
first_char = 0
last_char = -1
if s[first_char] != s[last_char]:
print("It is not a Palindrome")
i = 0
while i >= n[-1]:
first_char = first_char + 1
last_char = last_char -1</i>
main()
</code></pre>