this is my python code . it runs fine in jupyter notebook but here i got runtime error or wrog answer . Please guide my .
def findordsum(a):
sum=0
for i in a:
sum += ord(i)
return sum
def lapindrome(string_input):
n = len(string_input)
if n ==1 :
return 'YES'
if n > 0:
if n%2==0:
first_half = findordsum(string_input[:(n//2)])
second_half = findordsum(string_input[(n//2) :])
else:
first_half = findordsum(string_input[:n//2])
second_half = findordsum(string_input[(n//2)+1 :])
if first_half == second_half:
return 'YES'
else:
return 'NO'
a = int(input())
while a >0:
b = input()
c = lapindrome(b)