qyliang/CodeNanoFix huggingface dataset:
Buggy code:
S = list(input())
N = len(S)
S2 = S[:(N-1)//2+2]
if S == S[::-1] and S2 == S2[::-1]:
    print('Yes')
else:
    print('No')

Fixed code:
S = input()
N = len(S)
S2 = S[:(N-1)//2]
if S == S[::-1] and S2 == S2[::-1]:
    print('Yes')
else:
    print('No')
Buggy code:
s = input()
n = len(s)
s1, s2 = s[:(n-1)//2], s[(n+2)//2:]
print(s1, s2)
if s == s[::-1] and s1 == s1[::-1] and s2 == s2[::-1]:
    print('Yes')
else:
    print('No')


Fixed code:
s = input()
s1 = s[:len(s)//2]
s2 = s[len(s)//2+1:]

#print(s,s1,s2)
if s == s[::-1] and s1 == s1[::-1] and s2 == s2[::-1]:
    print("Yes")
else:
    print("No")
Buggy code:
S = input()
N = len(S)
if S == S[::-1] and  S[:(N-1)//2] == S[:(N-1)//2:-1] and S[(N+1)//2:] == S[(N+1)//2::-1] :
  print('Yes')
else:
  print('No')


Fixed code:
S = input()
N = len(S)
if S == S[::-1] and  S[:(N-1)//2] == S[(N-3)//2::-1] and S[(N+1)//2:] == S[:(N-1)//2:-1] :
  print('Yes')
else:
  print('No')
Buggy code:
# -*- coding: utf-8 -*-
def Palindrome(S):
    if len(S)==1:
        return "Yes"
    for i in range(int((len(S)-1)/2)):
        if S[i]==S[len(S)-i-1]:
            YorN="Yes"
        else:
            YorN="No"
            break
    return YorN
S = input()
Sl = list(S)
left = right = "No"
if Palindrome(Sl) == "Yes":
    middle=int((len(Sl)-1)/2)
    print(Sl[:middle],Sl[middle+1:])
    left  = Palindrome(Sl[:middle])
    right = Palindrome(Sl[middle+1:])
if left == "Yes" and right == "Yes":
    YorN = "Yes"
else:
    YorN = "No"
print(YorN)


Fixed code:
# -*- coding: utf-8 -*-
def Palindrome(S):
    if len(S)==1:
        return "Yes"
    for i in range(int((len(S))/2)):
        if S[i]==S[len(S)-i-1]:
            YorN="Yes"
        else:
            YorN="No"
            break
    return YorN
S = input()
Sl = list(S)
left = right = "No"
if Palindrome(Sl) == "Yes":
    middle=int((len(Sl)-1)/2)
#    print(Sl[:middle],Sl[middle+1:])
    left  = Palindrome(Sl[:middle])
    right = Palindrome(Sl[middle+1:])
if left == "Yes" and right == "Yes":
    YorN = "Yes"
else:
    YorN = "No"
print(YorN)
Buggy code:
s = input()

n = len(s)
l = int((n-1)/2)
b = int((n+3)/2)

for i in range(l - int(l/2)):
    print(s[i])
    print(s[l-1-i])
    if not s[i] == s[l-1-i]:
        print('No')
        exit()

for i in range(n-b - int((n-b)/2)):
    print(s[b-1+i])
    print(s[n-1-i])
    if not s[b-1+i] == s[n-1-i]:
        print('No')
        exit()

for i in range(int(n/2)):
    if not s[i] == s[n-1-i]:
        print('No')
        exit()

print('Yes')


Fixed code:
s = input()

n = len(s)
l = int((n-1)/2)
b = int((n+3)/2)

for i in range(l - int(l/2)):
    if not s[i] == s[l-1-i]:
        print('No')
        exit()

for i in range(n-b - int((n-b)/2)):
    if not s[b-1+i] == s[n-1-i]:
        print('No')
        exit()

for i in range(int(n/2)):
    if not s[i] == s[n-1-i]:
        print('No')
        exit()

print('Yes')
Buggy code:
s = input()
n = len(s)
a = s[:(n-1)//2-1]
b = s[-(n+3)//2:]
e = s[
t = s[::-1]
c = t[:(n-1)//2-1]
d = t[-(n+3)//2:]
if (a==b) and (b==c) and (c==d):
  print('Yes')
else:
  print('No')


Fixed code:
s = input()
n = len(s)
a = s[:(n-1)//2]
b = s[(n+3)//2-1:]

t = s[::-1]
c = t[:(n-1)//2]
d = t[(n+3)//2-1:]
if (a==b) and (b==c) and (c==d) and (d==a):
  print('Yes')
else:
  print('No')
Buggy code:
string = input()
mid = len(s)//2

gnirts = reversed(string)
print(gnirts)
if(string != gnirts or string[:mid-1] != gnirts[mid+1:] or string[mid+1:] != gnirts[:mid-1]):
  print("No")
  exit()
print("Yes")

Fixed code:
string = input()
mid = len(string)//2

gnirts = string[::-1]
if(string != gnirts or string[:mid] != gnirts[mid+1:] or string[mid+1:] != gnirts[:mid]):
  print("No")
  exit()
print("Yes")
Buggy code:
S=list(input())
n=len(S)
ans='No'
if S==list(reversed(S)):
    new=S[0:((n-1)//2)]
    if new==list(reversed(new)):
        new2=S[((n+3)//2):N+1]
        if new2==list(reversed(new2)):
            ans='Yes'
print(ans)

Fixed code:
S=list(input())
n=len(S)
ans='No'
if S==list(reversed(S)):
    new=S[0:((n-1)//2)]
    if new==list(reversed(new)):
        new2=S[((n+3)//2)-1:]
        if new2==list(reversed(new2)):
            ans='Yes'
print(ans)
Buggy code:
def check(s):
	l = len(s)
	c = 1

	if l != 1:

		if l % 2 == 1:
			l -= 1

		for i in range(int(l/2)):
			if s[i] != s[0-1-i]:
				c = 0

	return c

if __name__ == '__main__':
	S = input()
	LEN = len(S)
	l = int((LEN-1)/2)

	r = l+1
	s1 = S[0:l]
	s2 = S[r:LEN]

	print(s1)
	print(s2)

	c = check(s1) * check(s2) * check(S)

	if c == 1:
		print('Yes')
	else:
		print('No')

Fixed code:
def check(s):
	l = len(s)
	c = 1

	if l != 1:

		if l % 2 == 1:
			l -= 1

		for i in range(int(l/2)):
			if s[i] != s[0-1-i]:
				c = 0

	return c

if __name__ == '__main__':
	S = input()
	LEN = len(S)
	l = int((LEN-1)/2)

	r = l+1
	s1 = S[0:l]
	s2 = S[r:LEN]

	c = check(s1) * check(s2) * check(S)

	if c == 1:
		print('Yes')
	else:
		print('No')
Buggy code:
S=input()
T=S[:N//2]
U=S[N//2+1:]
N=len(S)
flg=0
for i in range(int((N-1)/2)):
  if(S[i]!=S[-i]):
    break
  flg+=1

for j in range(len(T)//2):
  if(T[j]!=T[-j]):
    break
  flg+=1

for k in range(len(U)//2):
  if(U[k]!=U[-k]):
    break
  flg+=1

if(flg==3):
  print("Yes")
else:
  print("No")

Fixed code:
S=input()
N=len(S)
T=S[:N//2]
U=S[N//2+1:]

flg=0

for i in range(int((N-1)/2)):
  if(S[i]!=S[-i-1]):
    flg=1
    break
  
for j in range(len(T)//2):
  if(T[j]!=T[-j-1]):
    flg=1
    break
  
for k in range(len(U)//2):
  if(U[k]!=U[-k-1]):
    flg=1
    break

if(flg==0):
  print("Yes")
else:
  print("No")
Buggy code:
S = input().strip('\n')
S1=S[:(len(S)-1)//2]
S2=S[(len(S)-1)//2+1:]
flag=True
if (len(S)-1)//2%2==1:
    for i in range(len(S)//2//2): 
        if S1[i]!=S2[-i-1] or S1[i]!=S1[-i-1] or S2[i]!=S2[-i-1]:
            flag=False
print('Yes' if flag else 'No')

Fixed code:
S = input().strip('\n')
S1=S[:(len(S)-1)//2]
S2=S[(len(S)-1)//2+1:]
flag=True
for i in range(len(S)//2):
    if S[i]!=S[-i-1]:
        flag=False               
for i in range(len(S)//2//2):
    if S1[i]!=S1[-i-1] or S2[i]!=S2[-i-1]:
        flag=False
print('Yes' if flag else 'No')
Buggy code:
s = input()
n = len(s)
s1 = s[:(n - 1) // 2]
s2 = s[(n + 3) // 2 - 1:]
print(s2)
if s1 == s1[::-1] and s2 == s2[::-1]:
    print("Yes")
else:
    print("No")


Fixed code:
s = input()
n = len(s)

s1 = s[:n // 2]
s2 = s[n // 2 + 1:]

print("Yes" if s1 == s1[::-1] and s2 == s2[::-1] and s == s[::-1] else "No")
Buggy code:
s = input()
s_len = len(s)
s1 = s[0:int((s_len - 1) / 2)]
s2 = s[int((s_len + 3) / 2) - 1:s_len]

print(s1)
print(s2)

if s1 == s1[::-1] and s2 == s2[::-1]:
    print('Yes')
else:
    print('No')


Fixed code:
s = input()
s_len = len(s)
s1 = s[0:int((s_len - 1) / 2)]
s2 = s[int((s_len + 3) / 2) - 1:s_len]
if s1 == s1[::-1] and s2 == s2[::-1] and s == s[::-1]:
    print('Yes')
else:
    print('No')
Buggy code:
import copy
S = list(input())
N = len(S)
ReS = copy.copy(S)
o = 1
for i in S:
    ReS[N-o] = i
    o += 1
if S == reversed(S):
    print("Yes")
if S == ReS:
    if S[0:int((N-1)/2)] == ReS[int((N+1)/2): N]:
        if S[int(N+1/2): N] == ReS[0:int((N-1)/2)]:
            print("Yes")
        else:
            print("No")
    else:
        print("No")
else:
        print("No")


Fixed code:
import copy
S = list(input())
N = len(S)
ReS = copy.copy(S)
o = 1
for i in S:
    ReS[N-o] = i
    o += 1
if S == reversed(S):
    print("Yes")
if S == ReS:
    if S[0:int((N-1)/2)] == ReS[int((N+1)/2): N]:
        if S[int((N+1)/2): N] == ReS[0:int((N-1)/2)]:
            print("Yes")
        else:
            print("No")
    else:
        print("No")
else:
        print("No")
Buggy code:
s=list(input())
t=list(reversed(s))
p=s[:(len(s) - 1) // 2]
q=list(reversed(p))
r=s[(len(s) - 1) // 2:]
u=list(reversed(r))
if s == t:
    if p == q:
        if r == s:
            print("Yes")        
else:
    print("No")

Fixed code:
s=list(input())
t=list(reversed(s))
p=s[:(len(s) - 1) // 2]
q=list(reversed(p))
#r=s[(len(s) - 1) // 2:]
#u=list(reversed(r))
if s == t:
    if p == q:
        
        print("Yes")
        
    else:
        print("No")
    
else:
    print("No")
Buggy code:
S = input()
c = True
for i in range (len(S)//2):
  if S[i]=S[len(S)//2-i-1]=S[len(S)//2+1+i]=S[len(S)-i-1]:
    c = True
  else:
    c = False
if (c):
  print('Yes')
else:
  print('No')

Fixed code:
S = input()
c = True
for i in range (len(S)//2):
  if S[i]==S[len(S)//2-i-1]==S[len(S)//2+1+i]==S[len(S)-i-1]:
    c = True
  else:
    c = False
    break
if (c):
  print('Yes')
else:
  print('No')
Buggy code:
s = list(input())

thresh_1 = int((len(s) - 1) / 2)
thresh_2 = int((len(s) + 3) / 2)

s_1 = s[:thresh_1]
s_2 = s[thresh_2 - 1:]
print(s_1)
print(s_2)
if s == s[::-1] and s_1 == s_1[::-1] and s_2 == s_2[::-1]:
    print('Yes')
else:
    print('No')


Fixed code:
s = list(input())

thresh_1 = int((len(s) - 1) / 2)
thresh_2 = int((len(s) + 3) / 2)

s_1 = s[:thresh_1]
s_2 = s[thresh_2 - 1:]

if s == s[::-1] and s_1 == s_1[::-1] and s_2 == s_2[::-1]:
    print('Yes')
else:
    print('No')
Buggy code:
S= input()
N = len(S)
A = (len(S) - 1) // 2
B = (len(S) + 3) // 2
if S[0:A] == S[B - 1:N]:
  print('Yes')
elif:
  print('No')

Fixed code:
S = input()
N = len(S)
A = (len(S) - 1) // 2
B = (len(S) + 3) // 2
if S[0:A] == S[B - 1:N]:
  print('Yes')
else:
  print('No')
Buggy code:
s=list(str(input()))
l=len(s)
t=list(reversed(s))
a=[]
if s==t:
  for i in range(0,int((l-1)/2)):
    if s[i]==s[int((l-1)/2-i)-1]:
      a.append(s[i])
  if len(a)==(l-1)/2:
    print("Yes")
  else:
    print("No")
 

Fixed code:
s=list(str(input()))
l=len(s)
t=list(reversed(s))
a=[]
if s==t:
  for i in range(0,int((l-1)/2)):
    if s[i]==s[int((l-1)/2-i)-1]:
      a.append(s[i])
  if len(a)==(l-1)/2:
    print("Yes")
  else:
    print("No")
else:
  print("No")
Buggy code:
S=input()
N=len(S)
S1=S[:(N+1)/2]
S2=S[(N+3)/2:]
if S == S[::-1] and S1 == S1[::-1] and S2 == S2[::-1]:
  print("Yes")
else:
  print("No")

Fixed code:
S=input()
N=len(S)
S1=S[:int((N-1)/2)]
S2=S[int((N+1)/2):]
if S == S[::-1] and S1 == S1[::-1] and S2 == S2[::-1]:
  print("Yes")
else:
  print("No")
Buggy code:
s=list(input())
N=len(s)
tmp=s[0:int((N-1)/2)+1]
tmp_rev=tmp[::-1]

tmp2=s[int((N+3)/2):N+1]
tmp2_rev=tmp2[::-1]

if tmp==tmp_rev and tmp2==tmp2_rev:
  print("Yes")
else:
  print("No")

Fixed code:
s=list(input())
N=len(s)
if N==3:
  if s[0]==s[2]:
    print("Yes")
  else:
    print("No")
else:
  tmp=s[0:int((N-1)/2)]
  tmp_rev=tmp[::-1]

  tmp2=s[int((N+3)/2)-1:]
  tmp2_rev=tmp2[::-1]

  if tmp==tmp_rev and tmp2==tmp2_rev and s==s[::-1]:
    print("Yes")
  else:
    print("No")
Buggy code:
s = input()
l = len(s)
a = s[:(l-1)/2]
b = len(a)
print("Yes" if s[:(l-1)/2] == s[(l+1)/2:] and a[:(b-1)/2] == a[(b+1)/2:] else "No")

Fixed code:
s=input()
l=len(s)//2
a=s[:l]
b=s[l+1:]
if a==a[::-1] and b==b[::-1] and s==s[::-1]:
  print('Yes')
else:
  print('No')
Buggy code:
s = list(input())
n = len(s)
if n==n[::-1] and n[0:int((n-1)/2)]==n[0:int((n-1)/2)][::-1] and n[int((n+3)/2-1):n]==n[int((n+3)/2-1):n][::-1]:
  print('Yes')
else:
  print('No')


Fixed code:
s = list(input())
n = len(s)
if s==s[::-1] and s[0:int((n-1)/2)]==s[0:int((n-1)/2)][::-1] and s[int((n+3)/2-1):n]==s[int((n+3)/2-1):n][::-1]:
  print('Yes')
else:
  print('No')
Buggy code:
import sys
s=input()
s_pre = s[:(n-1)//2]
s_epi = s[(n+1)//2:]
n = len(s)
if s != s[::-1]:
    print('No')
    sys.exit()
if s_pre != s_pre[::-1]:
    print('No')
    sys.exit()
if s_epi != s_epi[::-1]:
    print('No')
    sys.exit()
print('Yes')

Fixed code:
import sys
s=input()
n=len(s)
s_pre = s[:(n-1)//2]
s_epi = s[(n+1)//2:]
if s != s[::-1]:
    print('No')
    sys.exit()
if s_pre != s_pre[::-1]:
    print('No')
    sys.exit()
if s_epi != s_epi[::-1]:
    print('No')
    sys.exit()
print('Yes')
Buggy code:
S = list(input())
len_s = len(S)
print(len_s)
right = S[0:(len_s-1)//2]
left = S[(len_s+3)//2-1:]
if S != list(reversed(S)):
    print("No")
elif right != list(reversed(right)):
    print("No")
elif left != list(reversed(left)):
    print("No")
else:
    print("Yes")


Fixed code:
S = list(input())
len_s = len(S)
right = S[0:(len_s-1)//2]
left = S[(len_s+3)//2-1:]
if S != list(reversed(S)):
    print("No")
elif right != list(reversed(right)):
    print("No")
elif left != list(reversed(left)):
    print("No")
else:
    print("Yes")
Buggy code:
S = list(input())
N = len(S)
S0 = S[:(N - 1) // 2]
S1 = S[(N + 1) // 2:]
print(S0, S1, S)
if S0 == S0[::-1] and S1 == S1[::-1] and S == S[::-1]:
    print('Yes')
else:
    print('No')


Fixed code:
S = list(input())
N = len(S)
S0 = S[:(N - 1) // 2]
S1 = S[(N + 1) // 2:]
if S0 == S0[::-1] and S1 == S1[::-1] and S == S[::-1]:
    print('Yes')
else:
    print('No')
Buggy code:
import itertools
import functools
import math
from collections import Counter
from itertools import combinations


S=input()

N=int(len(S))

A1=S[:N//2]
A2=S[((N+3)//2)-1:]


chk = 0
for i in range((N-1)//2):
    if A1[i] != A1[((N-1)//2) - (N%2) - i]:
        print(i)
        chk = 1
        break
    if A2[i] != A2[((N-1)//2) - (N%2) - i]:
        chk = 1
        break

if chk == 0:
    print('Yes')
else:
    print('No')


Fixed code:
import itertools
import functools
import math
from collections import Counter
from itertools import combinations


S=input()

N=int(len(S))

A1=S[:N//2]
A2=S[((N+3)//2)-1:]


chk = 0

for i in range(N-1//2):
    if S[i]!=S[N-1-i]:
        chk = 1
        print('No')
        exit()

for i in range((N-1)//2):
    if A1[i] != A1[((N-1)//2) - (N%2) - i]:
        chk = 1
        break
    if A2[i] != A2[((N-1)//2) - (N%2) - i]:
        chk = 1
        break

if chk == 0:
    print('Yes')
else:
    print('No')
Buggy code:
def pal(t):
  return t == t[::-1];


s = input();
f = pal(s) and pal(s[0:(len(s)//2 - 1):]) and pal(s[(len(s)//2 + 1)::]);
#f = pal(s);
if f == True:
  print("Yes");
else:
  print("No");


Fixed code:
def pal(t):
  return t == t[::-1];


s = input();
f = pal(s) and pal(s[0:len(s)//2:]) and pal(s[(len(s)//2 + 1)::]);
#f = pal(s);
if f == True:
  print("Yes");
else:
  print("No");
Buggy code:
ls = list(map(str,input()))
a=[]
b=[]
c=[]
d=[]
e=[]
f=[]
n = len(ls)
for i in range(int((n-1)/2)):
    a.append(ls[i])
for j in range(int((n+1)/2),n):
    b.append(ls[j])
b.reverse()
if b != a:
    print('No')
else:
    if (n-1) % 4 ==0:
        for k in range(int((n-1)/4)):
            c.append(a[i])
        for l in range(int((n-1)/4),(n-1)/2):
            d.append(a[i])
        for m in range(int((n-1)/4)):
            e.append(b[i])
        for n in range(int((n-1)/4),int((n-1)/2)):
            f.append(b[i])
        d.reverse()
        f.reverse()
        if (c == d) and (e == f):
            print('Yes')
        else:
            print('No')
    else:
        for k in range(int((n-3)/4)):
            c.append(a[i])
        for l in range(int((n+1)/4),int((n-1)/2)):
            d.append(a[i])
        for m in range(int((n-3)/4)):
            e.append(b[i])
        for n in range(int((n+1)/4),int((n-1)/2)):
            f.append(b[i])
        d.reverse()
        f.reverse()
        if (c == d) and (e == f):
            print('Yes')
        else:
            print('No')
        


Fixed code:
ls = list(map(str,input()))
a=[]
b=[]
c=[]
d=[]
e=[]
f=[]
n = len(ls)
for i in range(int((n-1)/2)):
    a.append(ls[i])
for j in range(int((n+1)/2),n):
    b.append(ls[j])
b.reverse()
if b != a:
    print('No')
else:
    if (n-1) % 4 ==0:
        for k in range(int((n-1)/4)):
            c.append(a[k])
        for l in range(int((n-1)/4),int((n-1)/2)):
            d.append(a[l])
        for m in range(int((n-1)/4)):
            e.append(b[m])
        for n in range(int((n-1)/4),int((n-1)/2)):
            f.append(b[n])
        d.reverse()
        f.reverse()
        if (c == d) and (e == f):
            print('Yes')
        else:
            print('No')
    else:
        for k in range(int((n-3)/4)):
            c.append(a[k])
        for l in range(int((n+1)/4),int((n-1)/2)):
            d.append(a[l])
        for m in range(int((n-3)/4)):
            e.append(b[m])
        for n in range(int((n+1)/4),int((n-1)/2)):
            f.append(b[n])
        d.reverse()
        f.reverse()
        if (c == d) and (e == f):
            print('Yes')
        else:
            print('No')
Buggy code:
def checkPal(s):
  w = s
  w[::-1]
  if w==s:
    return True
  return False
s = input()
if checkPal(s[:(n//2)]) and checkPal(s) and checkPal(s[(n//2)+1:]:
  print("Yes")
else:
  print("No")

Fixed code:
def checkPal(s):
  if s[::-1]==s:
    return True
  return False
s = input()
n = len(s)
if checkPal(s[:(n//2)]) and checkPal(s) and checkPal(s[(n//2)+1:]):
  print("Yes")
else:
  print("No")
Buggy code:
s=input()

def judge_palindrome(x):
	if x==x[::-1]:
		return True
	else:
		return False

if judge_palindrome(s) and judge_palindrome(s[:int((len(s)-1)/2)]) and judge_palindrome(s[int((len(s)+3)/2):]):
	print('Yes')
else:
	print('No')

Fixed code:
s=input()

def judge_palindrome(x):
	if x==x[::-1]:
		return True
	else:
		return False

if judge_palindrome(s)==True and judge_palindrome(s[:int((len(s)-1)/2)])==True and judge_palindrome(s[int((len(s)+3)/2)-1:])==True:
	print('Yes')
else:
	print('No')
Buggy code:
S=input()
N=len(S)
i=0

if((N-1)/2%2==1):
    while (i<((N-1)/2-1)/2):
        print(S[i],S[int((N-1)/2-i-1)],S[int((N-1)/2+1+i)],S[int(N-1-i)])
        if( (S[i]==S[int((N-1)/2-i-1)]) & (S[i]==S[int((N-1)/2+1+i)]) & (S[i]==S[int(N-1-i)]) ):
            i+=1
        else:
            break;
    if(i==int((N-1)/2-1)/2):
        print('Yes')
    else:
        print('No')
    
else:
    while (i<=(N-1)/4):
        print(S[i],S[int((N-1)/2-i-1)],S[int((N-1)/2+1+i)],S[int(N-1-i)])
        if( (S[i]==S[int((N-1)/2-i-1)]) & (S[i]==S[int((N-1)/2+1+i)]) & (S[i]==[int(N-1-i)]) ):
            i+=1
        else:
            break;
    if(i==(N-1)/4):
        print('Yes')
    else:
        print('No')

Fixed code:
S=input()
N=len(S)
i=0
if((N-1)/2%2==1):
    while (i<=((N-1)/2-1)/2):
        if( (S[i]==S[int((N-1)/2-i-1)]) & (S[i]==S[int((N-1)/2+1+i)]) & (S[i]==S[int(N-1-i)]) ):
            i+=1
        else:
            break;
    if(i==int(((N-1)/2-1)/2+1)):
        print('Yes')
    else:
        print('No')
    
else:
    while (i<=(N-1)/4):
        if( (S[i]==S[int((N-1)/2-i-1)]) & (S[i]==S[int((N-1)/2+1+i)]) & (S[i]==S[int(N-1-i)]) ):
            i+=1
        else:
            break;
    if(i==int((N-1)/4+1)):
        print('Yes')
    else:
        print('No')
Buggy code:
text = str(input())
n = len(text)
target = (n-1)//2

bef = text[:target]
aft = text[target+1:]

if bef == aft[::-1]:
  print("Yes")
else:
  print("No")

Fixed code:
text = str(input())
n = len(text)
target = (n-1)//2
 
bef = text[:target]
aft = text[target+1:]
 
if bef == aft:
  print("Yes")
else:
  print("No")
Buggy code:
S = input()
N = len(S)
zen = S[:int((N-1)/2)]
kou = S[int((N+3)/2)-1:]
if zen == zen[::-1] and kou == kou[::-1]
    print("Yes")
else:
    print("No")

Fixed code:
S = input()
N = len(S)
zen = S[:int((N-1)/2)]
kou = S[int((N+3)/2)-1:]
if S == S[::-1] and zen == zen[::-1] and kou == kou[::-1]:
    print("Yes")
else:
    print("No")
Buggy code:
S = input()
N = len(S)

def evaluate(string):
  return string[:] == string[::-1]

print(S[:int((N-1)/2)])
print("Yes" if evaluate(S[:int((N-1)/2)]) else "No")

Fixed code:
S = input()
N = len(S)

def evaluate(string):
  return string[:] == string[::-1]

print("Yes" if evaluate(S[:int((N-1)/2)]) and evaluate(S) else "No")
Buggy code:
S = input()
def check(s):
  return s[:int((len(s)-1)/2+1)]==s[int((len(s)-1)/2):][::-1]
if check(S) and check(S[:int((len(S)-1)/2+1)]) and check(S[int((len(S)+3)/2):]):
  print('Yes')
else:
  print('No')

Fixed code:
S = input()

def check(s):
  return s==s[::-1]

if check(S) and check(S[:int((len(S)-1)/2)]) and check(S[int((len(S)+3)/2-1):]):
  print('Yes')
else:
  print('No')
Buggy code:
s = input()
n = len(s)
cnt = 0
if s == s[::-1]:
    cnt += 1

idx = (n-1)//2
if s[:idx] == s[:idx][::-1]:
    cnt += 1
idx = (n+3)//2
if s[idx:] == s[idx:][::-1]:
    cnt += 1

print("Yes" if cnt == 3 else "No")


Fixed code:
s = input()
n = len(s)
cnt = 0
if s == s[::-1]:
    cnt += 1
idx = (n-1)//2
if s[:idx] == s[:idx][::-1]:
    cnt += 1
idx = (n+3)//2-1
if s[idx:] == s[idx:][::-1]:
    cnt += 1
print("Yes" if cnt == 3 else "No")
Buggy code:
s=input()
n=len(s)
def p(s):
  return s==s[::-1]
if p(s[:(n-1)//2]):
  if p(s[(n+1)//2:]):
    print('Yes')
   else:
    print('No')
print('No')

Fixed code:
s=input()
n=len(s)
def p(s):
  return s==s[::-1]
if p(s):
  if p(s[:(n-1)//2]):
    if p(s[(n+1)//2:]):
      print('Yes')
      exit()
    else:
      print('No')
      exit()
print('No')
Buggy code:
from sys import stdin


def check_palindrome(str_):
    if str_ == str_[::-1]:
       return True
    return False

def get_result(data):
    S = data[0]
    right_idx = int((len(S) - 1) / 2)
    left_idx = int((len(S) + 3) / 2) - 1
    right_S = S[0:right_idx]
    left_S = S[left_idx:]
    if check_palindrome(S) and check_palindrome(right_S) and check_palindrome(left_S):
        return 'Yes'
    return 'No'


if __name__ == '__main__':
    data = list(map(str, stdin.readline().split(' ')))
    result = get_result(data)
    print(result)

Fixed code:
from sys import stdin


def check_palindrome(str_):
    if str_ == str_[::-1]:
       return True
    return False

def get_result(data):
    S = data[0]
    right_idx = int((len(S) - 1) / 2)
    left_idx = int((len(S) + 3) / 2) - 1
    right_S = S[0:right_idx]
    left_S = S[left_idx:]
    if check_palindrome(S) and check_palindrome(right_S) and check_palindrome(left_S):
        return 'Yes'
    return 'No'


if __name__ == '__main__':
    data = list(map(str, stdin.readline().rstrip('\n').split(' ')))
    result = get_result(data)
    print(result)
Buggy code:
s=input()
n=len(s)
p=n//2
t=1

for i in range(p):
    if s[i]==s[p-1-i]:
        t=1
    else:
        t=0
        break;

x=1

for i in range(p):
    if s[p+1+i]==s[n-1-i]:
        x=1
   else:
       x=0
       break

y=1

for i in range(n):
    if s[i]==s[n-1-i]:
        y=1
   else:
       y=0
       break

if (t==1 and x==1 and y==1):
    print('Yes')
else:
    print('No')

Fixed code:
s=input()
n=len(s)
p=n//2
t=1

for i in range(p):
    if s[i]==s[p-1-i]:
        t=1
    else:
        t=0
        break;

x=1

for i in range(p):
    if s[p+1+i]==s[n-1-i]:
        x=1
    else:
       x=0
       break

y=1

for i in range(n):
    if s[i]==s[n-1-i]:
        y=1
    else:
       y=0
       break

if (t==1 and x==1 and y==1):
    print('Yes')
else:
    print('No')