Precise Python code


#1

def isPalindrome(self, A):
c=’’
x=’’.join(A)
for i in x:
if (ord(i)>64 and ord(i)<91) or (ord(i)>96 and ord(i)<123) or i.isdigit()==True:
c=c+i
c=c.upper()
if c==c[::-1]:
return 1
return 0