qyliang/CodeNanoFix huggingface dataset:
Buggy code:
import numpy as np

def judge(s1, s2):
    l = len(s1)
    for i in range(l):
        if(s1[i] != s2[l-1-i]):
            return 'No'
    return 'Yes'

def main():
    args = input().rstrip().split(' ')
    S = np.array([c for c in args[0]])
    l = len(S)
    s1 = np.array([S[i] for i in range(0, int(l/2))])
    s2 = np.array([S[i] for i in range(int(l/2)+1, l)])
    print(judge(s1, s2))
    
    
if __name__ == "__main__":
    main()

Fixed code:
import numpy as np

def judge(s):
    l = len(s)
    for i in range(int(l/2)):
        if(s[i] != s[l-1-i]):
            return False
    return True

def main():
    args = input().rstrip().split(' ')
    S = np.array([c for c in args[0]])
    l = len(S)
    s1 = np.array([S[i] for i in range(0, int(l/2))])
    s2 = np.array([S[i] for i in range(int(l/2)+1, l)])
    if(judge(S) and judge(s1) and judge(s2)):
        print('Yes')
    else:
        print('No')
    
    
if __name__ == "__main__":
    main()
Buggy code:
s = input()
n = len(s)
for i in range((n//2)):
  if(s[i] != s[-(i+1)]):
    print("No")
    exit()
for i in range(((n//2)//2)):
  print(s[i],s[((n//2)-1)-i])
  if((s[i] != s[((n//2)-1)-i]) and s[((n+3)/2) != s[-(i+1)]]):
    print("No")
    exit()
print("Yes")

Fixed code:
s = input()
n = len(s)
for i in range((n//2)):
  if(s[i] != s[-(i+1)]):
    print("No")
    exit()
for i in range(((n//2)//2)):
  if((s[i] != s[((n//2)-1)-i]) and (s[((n+3)/2) != s[-(i+1)]])):
    print("No")
    exit()
print("Yes")
Buggy code:
S = input()
flag = 0
for i in range(0,len(S)//2):
    if S[i] == S[-1-i]:
        continue
    else:
        flag = 1
        print("No")
        break
if flag == 0:
    S = S[:((len(S)-1)//2)]
    print(S)
    for i in range(0,len(S)//2):
        if S[i] == S[-1-i]:
            continue
        else:
            flag = 1
            print("No")
            break
if flag == 0:
    print("Yes")

Fixed code:
S = input()
flag = 0
for i in range(0,len(S)//2):
    if S[i] == S[-1-i]:
        continue
    else:
        flag = 1
        print("No")
        break
if flag == 0:
    S = S[:((len(S)-1)//2)]
    for i in range(0,len(S)//2):
        if S[i] == S[-1-i]:
            continue
        else:
            flag = 1
            print("No")
            break
if flag == 0:
    print("Yes")
Buggy code:
S = input()
judge = True
for i in range(len(S)//2 + 2):
    if S[i] != S[len(S) - i - 1]:
        judge = False
        break


if judge:        
    for i in range(int((len(S)-1)/2)):
  
        if S[i] != S[int((len(S)-1)/2)- 1 - i]:
            judge = False
            break
        elif S[int((N+3)/2)-1 + i] != S[N-1-i]:
            judge = False
            break

if judge:
    print("Yes")
else:
    print("No")

Fixed code:
S = input()
N = len(S)
judge = True
for i in range(len(S)//2):
    if S[i] != S[len(S) - i - 1]:
        judge = False
        break


if judge:        
    for i in range(int((len(S)-1)/2)):
  
        if S[i] != S[int((len(S)-1)/2)- 1 - i]:
            judge = False
            break
        elif S[int((N+3)/2)-1 + i] != S[N-1-i]:
            judge = False
            break

if judge:
    print("Yes")
else:
    print("No")
Buggy code:
s = input()
hs = s[:int((len(s)-1)/2)]
def iskb(s):
    n = len(s)
    k = 1
    for i in range(int((n-1)/2)):
        if s[i] != s[-(i+1)]:
            k = 0
            break
    return k
if iskb(s)+iskb(hs) == 2:
    print("Yes")
else:
    print("No")

Fixed code:
s = input()
hs = s[:int((len(s)-1)/2)]
def iskb(s):
    n = len(s)
    k = 1
    for i in range(int((n-1)/2)):
        if s[i] != s[-(i+1)]:
            k = 0
            break
    return k
def iskb2(s):
    n = len(s)
    k = 1
    for i in range(int(n/2)):
        if s[i] != s[-(i+1)]:
            k = 0
            break
    return k

if int((len(s)-1)/2)%2 == 0:
    if iskb(s)+iskb2(hs) == 2:
        print("Yes")
    else:
        print("No")
else:
    if iskb(s)+iskb(hs) == 2:
        print("Yes")
    else:
        print("No")
Buggy code:
import sys
def is_pal(s):
    print(s,'s')
    i,j=0,len(s)-1
    while i<=j:
        if s[i]==s[j]:
            i+=1
            j-=1
        else:
            return False
    return True
s=sys.stdin.readline()[:-1]
n=len(s)
if n%2!=0:
    if is_pal(s[:n//2]) and is_pal(s[n//2+1:]) and is_pal(s):
        print('Yes')
    else:
        print('No')
else:
    print('No')


Fixed code:
import sys
def is_pal(s):
    #print(s,'s')
    i,j=0,len(s)-1
    while i<=j:
        if s[i]==s[j]:
            i+=1
            j-=1
        else:
            return False
    return True
s=sys.stdin.readline()[:-1]
n=len(s)
if n%2!=0:
    if is_pal(s[:n//2]) and is_pal(s[n//2+1:]) and is_pal(s):
        print('Yes')
    else:
        print('No')
else:
    print('No')
Buggy code:
import math as mt
#import numpy as np

def ro(n):
  return mt.floor(mt.sqrt(n))
def ya():
  print("Yes")
  return
def na():
  print("No")
  return


#a,b=map(int,input().split())
#lis=list(map(int,input().split()))
#n=int(input())
s=input()
if s!=s[::-1]:
  na()
n=(len(s)+1)//2
if s[:n-1]!=s[n:]:
  na()
else:
  ya()

Fixed code:
import math as mt
#import numpy as np

def ro(n):
  return mt.floor(mt.sqrt(n))
def ya():
  print("Yes")
  return
def na():
  print("No")
  return


#a,b=map(int,input().split())
#lis=list(map(int,input().split()))
#n=int(input())
s=input()

n=(len(s)+1)//2
if s[:n-1]!=s[n:] or s!=s[::-1]:
  na()
else:
  ya()
Buggy code:
st = input()

n = len(st)
half = (n-1)//2

if st[0:half] == st[n-1:half:-1]:
  if half%2 == 0:
    qu = half//2
    if st[:qu] == st[half-1:qu-1:-1] and st[half+1:half+qu+1] == st[n-1:half+qu:-1]:
      print("Yes")
  else:
    qu = (half-1)//2
    if st[:qu] == st[half-1:qu:-1] and st[half+1:half+qu+1] == st[n-1:half+qu+1:-1]:
      print("Yes")
      
else:
  print("No")
  

Fixed code:
st = input()

n = len(st)
half = (n-1)//2

if st[0:half] == st[n-1:half:-1]:
  if half%2 == 0:
    qu = half//2
    if st[:qu] == st[half-1:qu-1:-1] and st[half+1:half+qu+1] == st[n-1:half+qu:-1]:
      print("Yes")
    else:
      print("No")  
  else:
    qu = (half-1)//2
    if st[:qu] == st[half-1:qu:-1] and st[half+1:half+qu+1] == st[n-1:half+qu+1:-1]:
      print("Yes")
    else :
      print("No") 

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

Fixed code:
s = input()
l = len(s)
s1 = s[:(l - 1) // 2]
s2 = s[(l + 2) // 2:]
if s == s[::-1] and s1 == s1[::-1] and s2 == s2[::-1]:
    print('Yes')
else:
    print('No')
Buggy code:
S = input()
T = list(S)
Tlength = len(S)
N = int((len(S)-1)/2)
halfN1=int(N/2)
halfN2=int((Tlength+N)/2)
check=0
#print(T[Tlength-2])
#print(N)
#print(halfN1)
#print(halfN2)
for i in range(0,N):
    if T[i]!=T[Tlength-1-i]:
        check=1
        break
for i in range(0,halfN1):
    if T[i]!=T[N-1-i]:
        check=1
        break
for i in range(0,halfN1):
    if T[N+1+i]!=T[Tlength-1-i]:
        check=1
if check==1:
    print('NO')
else:
    print('Yes')
    

Fixed code:
S = input()
T = list(S)
Tlength = len(S)
N = int((len(S)-1)/2)
halfN1=int(N/2)
halfN2=int((Tlength+N)/2)
check=0
#print(T[Tlength-2])
#print(N)
#print(halfN1)
#print(halfN2)
for i in range(0,N):
    if T[i]!=T[Tlength-1-i]:
        check=1
        break
for i in range(0,halfN1):
    if T[i]!=T[N-1-i]:
        check=1
        break
for i in range(0,halfN1):
    if T[N+1+i]!=T[Tlength-1-i]:
        check=1
if check==1:
    print('No')
else:
    print('Yes')
Buggy code:
# coding: utf-8

import sys
import math
import collections
import itertools
from inspect import currentframe
INF = 10 ** 10
MOD = 10 ** 9 + 7
def input() : return sys.stdin.readline().strip()
def gcd(x, y) : return y if x % y == 0 else gcd(y, x % y)
def lcm(x, y) : return (x * y) // gcd(x, y)
def I() : return int(input())
def MI() : return map(int, input().split())
def LI() : return [int(x) for x in input().split()]
def RI(N) : return [int(input()) for _ in range(N)]
def LRI(N) : return [[int(x) for x in input().split()] for _ in range(N)]
def chkprint(*args) : names = {id(v):k for k,v in currentframe().f_back.f_locals.items()}; print(', '.join(names.get(id(arg),'???')+' = '+repr(arg) for arg in args))

S = input()

N = len(S)

if N >= 7:
    if S[0 : int((N - 1)/2)] == S[int((N + 1)/2) : int(N)]:
        print("Yes")
else:
    print("No")

Fixed code:
# coding: utf-8

import sys
import math
import collections
import itertools
from inspect import currentframe
INF = 10 ** 10
MOD = 10 ** 9 + 7
def input() : return sys.stdin.readline().strip()
def gcd(x, y) : return y if x % y == 0 else gcd(y, x % y)
def lcm(x, y) : return (x * y) // gcd(x, y)
def I() : return int(input())
def MI() : return map(int, input().split())
def LI() : return [int(x) for x in input().split()]
def RI(N) : return [int(input()) for _ in range(N)]
def LRI(N) : return [[int(x) for x in input().split()] for _ in range(N)]
def chkprint(*args) : names = {id(v):k for k,v in currentframe().f_back.f_locals.items()}; print(', '.join(names.get(id(arg),'???')+' = '+repr(arg) for arg in args))

S = input()

N = len(S)


if S[0 : int((N - 1)/2)] == S[int((N + 1)/2) : int(N)]:
    print("Yes")
else:
    print("No")
Buggy code:
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
def gcd(*numbers): reduce(math.gcd, numbers)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
count = 0
ans = 0
inf = float("inf")

S = s()
n = len(S)
a = S[:N//2]
b = S[N//2+1:]
print("Yes" if a == a[::-1] == b == b[::-1] else "No")


Fixed code:
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
def gcd(*numbers): reduce(math.gcd, numbers)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
count = 0
ans = 0
inf = float("inf")

S = s()
n = len(S)
a = S[:n//2]
b = S[n//2+1:]
print("Yes" if a == a[::-1] == b == b[::-1] else "No")
Buggy code:
n=len(s)
x=n//2
a=s[0:x]
b=s[x+1:]
if a==b:print('Yes')
else:print('No')

Fixed code:
s=input()
n=len(s)
x=n//2
a=s[0:x]
b=s[x+1:]
if a==b:print('Yes')
else:print('No')
Buggy code:
s = input()
n = len(s)
for i in range(n):
    if s[i] != s[-1 - i]:
        print("No")
        exit()
if s[:(n + 1) // 2] == s[(n + 3) // 2:]:
    print("Yes")
else:
    print("No")


Fixed code:
s = input()
n = len(s)
for i in range(n):
    if s[i] != s[-1 - i]:
        print("No")
        exit()
if s[:(n - 1) // 2] == s[(n + 1) // 2:]:
    print("Yes")
else:
    print("No")
Buggy code:
n=input()
s=len(n)
d=int((s-1)/2)
p=int(s+3)/2
m=n[::-1]
n1=n[0:d-1]
n2=n1[::-1]
n3=n[p-1:]
n4=n3[::-1]
if n==m and n1==n2 and n3==n4:
    print("Yes")
else:
    print("No")

Fixed code:
n=input()
s=len(n)
d=int((s-1)/2)
p=int((s+3)/2)
m=n[::-1]
n1=n[0:d]
n2=n1[::-1]
n3=n[p-1:]
n4=n3[::-1]
if n==m and n1==n2 and n3==n4:
    print("Yes")
else:
    print("No")
Buggy code:
s=list("akasaka")
N=len(s)
a=int((N-1)/2)
b=int((N+1)/2)
if  s[::-1]==s and s[:a]==s[b:]:
  print('Yes')
else:
  print('No')

Fixed code:
s=list(input())
N=len(s)
a=int((N-1)/2)
b=int((N+1)/2)
if  s[::-1]==s and s[:a]==s[b:]:
  print('Yes')
else:
  print('No')
Buggy code:
def gaus(n):
    if n//1<n:
        return int(n+1)
    return int(n)
def hante(S):
    n=len(S)
    for i in range(n//2):
        if S[i]!=S[n-i]:
            return False
    return True
S=input()
S1=S[:len(S)//2]
S2=S[gaus(len(S)/2):]
if hante(S1)==True and hante(S2)==True:
    print("Yes")
print("No")


Fixed code:
def gaus(n):
    if n//1<n:
        return int(n+1)
    return int(n)
def hante(S):
    n=len(S)
    for i in range(n//2):
        if S[i]!=S[n-i-1]:
            return False
    return True
S=input()
S1=S[:len(S)//2]
S2=S[gaus(len(S)/2):]

if hante(S)==True and hante(S1)==True and hante(S2)==True:
    print("Yes")
else:
    print("No")
Buggy code:
s  = input()
a = s[:len(s)/2 -1]
b = s[len(s)+3/2-1:]
flag = 0
if s == s[::-1]:
    if a == a[::-1]:
        if b == b[::-1]:
            flag = 1

if flag:
    print('Yes')
else:
    print('No')

Fixed code:

s  = input()
a = s[:int(len(s)/2)]
b = s[:-int(len(s)/2 + 1)]
flag = 0
if s == s[::-1]:
    if a == a[::-1]:
        if b == b[::-1]:
            flag = 1

if flag:
    print('Yes')
else:
    print('No')
Buggy code:
s = input()
def kai(l):
  n = len(l)
  output = 'Yes'
  for i in range(n%2):
    if l[i] != l[n-i-1]:
      output = 'No'
  return output

ans = kai(s)
if ans == 'Yes':
  ans = kai(s[:len(s)%2])
print(ans)

Fixed code:
s = input()
def kai(l):
  n = len(l)
  output = 'Yes'
  for i in range(n//2):
    if l[i] != l[n-i-1]:
      output = 'No'
  return output

ans = kai(s)
if ans == 'Yes':
  ans = kai(s[:len(s)//2])
if ans == 'Yes':
  ans = kai(s[len(s)//2+1:])
print(ans)
Buggy code:
s = input()
n = len(s)
a = s[:(n - 1) / 2 - 1]
b = s[(n + 3) / 2 - 1:]
print("Yes" if a = a[::-1] and b = b[::-1] else "No")

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

if a == b and a == a[::-1]:
  print("Yes")
else:
  print("No")
Buggy code:
S = input()
S1 = S[:int((len(s)-1)/2)]
S2 = S[int((len(s)+3)/2)-1:]
print('Yes' if S == S[::-1] and S1 == S1[::-1] and S2 == S2[::-1] else 'No')

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

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

Fixed code:
S = input()
N = len(S)
K = (N-3)//2
if S == S[::-1] and S[0:K] == S[K:0:-1]:
    print ('Yes')
else:
    print ('No')
Buggy code:
S=input()
L=len(S)
count=0
for i in range(L//2):
	print(S[i],S[-i-1])
	if S[i] == S[-i-1]:
		count+=1
	else:
		print("No")
		exit()

Sa=S[:(L-1)//2]
Sb=S[(L+3)//2-1:(L+1)]
La=len(Sa)
Lb=len(Sb)

for j in range(La//2):
	print(Sa[j],Sa[-j-1])
	if Sa[j] == Sa[-j-1]:
		count+=1
	else:
		print("No")
		exit()
        
for k in range(Lb//2):
	if Sb[k] == Sb[-k-1]:
		count+=1
	else:
		print("No")
		exit()
print("Yes")

Fixed code:
S=input()
L=len(S)
count=0
for i in range(L//2):
	if S[i] == S[-i-1]:
		count+=1
	else:
		print("No")
		exit()

Sa=S[:(L-1)//2]
Sb=S[(L+3)//2-1:(L+1)]
La=len(Sa)
Lb=len(Sb)

for j in range(La//2):
	if Sa[j] == Sa[-j-1]:
		count+=1
	else:
		print("No")
		exit()
        
for k in range(Lb//2):
	if Sb[k] == Sb[-k-1]:
		count+=1
	else:
		print("No")
		exit()
print("Yes")
Buggy code:
s = input()
n = len(s)
sd = s[::-1]
a = s[:int((n-1)/2)]
ad = a[::-1]
b = s[int((n+3)/2-1):]
bd = b[::-1]
print(s,sd,a,ad,b,bd)
if s == sd and a == ad and b == bd:
    print('Yes')
else:
    print('No')


Fixed code:
s = input()
n = len(s)
sd = s[::-1]
a = s[:int((n-1)/2)]
ad = a[::-1]
b = s[int((n+3)/2-1):]
bd = b[::-1]
if s == sd and a == ad and b == bd:
    print('Yes')
else:
    print('No')
Buggy code:
S = list(str(input()))
inv = list(reversed(S))
n = len(S)
d = int((n-1)/2)
q = int((n+1)/2)
if S != inv:
    print('No')
    print("1")
else:
    if S[:d] == S[q:]:
        print('Yes')
    else:
        print('No')

Fixed code:
S = list(str(input()))
inv = list(reversed(S))
n = len(S)
d = int((n-1)/2)
q = int((n+1)/2)
if S != inv:
    print('No')
else:
    if S[:d] == S[q:]:
        print('Yes')
    else:
        print('No')
Buggy code:
s = input()
n = len(s)
a = s[:(n-1)//2]
b = s[(n+3)//2:]

if a == b and a == a[::-1]:
  print('Yes')
else:
  print('No')

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

if a == b and a == a[::-1]:
  print('Yes')
else:
  print('No')
Buggy code:

import numpy as np
from functools import *
import sys
sys.setrecursionlimit(100000)


def is_kaibun(kaibun):
    for i in range(len(kaibun)//2):
        if kaibun[i] != kaibun[-i-1]:
            return False
    return True


s=input()
N=len(s)
l=int((N-1)/2 -1)
#r = int((N+3)/2 +1)
r=l+2
print(s,l,r)
if is_kaibun(s) and is_kaibun(s[:(l+1)]) and is_kaibun(s[r:]):
    print("Yes")
else:
    print("No")


Fixed code:

import numpy as np
from functools import *
import sys
sys.setrecursionlimit(100000)


def is_kaibun(kaibun):
    for i in range(len(kaibun)//2):
        if kaibun[i] != kaibun[-i-1]:
            return False
    return True


s=input()
N=len(s)
l=int((N-1)/2 -1)
#r = int((N+3)/2 +1)
r=l+2
#print(s,l,r)
if is_kaibun(s) and is_kaibun(s[:(l+1)]) and is_kaibun(s[r:]):
    print("Yes")
else:
    print("No")


#999999999 999999999
Buggy code:
S = input()

words = []
words.append(S)
words.append(S[:(N-1)//2])
words.append(S[(N+3)//2 - 1:])

ans = all([word == word[::-1] for word in words])

print("Yes" if ans else "No")

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

words = []
words.append(S)
words.append(S[:(N-1)//2])
words.append(S[(N+3)//2 - 1:])

ans = all([word == word[::-1] for word in words])

print("Yes" if ans else "No")
Buggy code:
import sys
S = input()
N = len(S)

if S == S[::-1]:
    if S[0:(N-1)/2] == S[0:(N-1)/2][::-1]:
        if S[((N+3)/2)-1:N] == S[((N+3)/2)-1:N][::-1]:
            print("Yes")
            sys.exit()


print("No")

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

if S == S[::-1]:
    if S[0:(N-1)//2] == S[0:(N-1)//2][::-1]:
        if S[((N+3)//2)-1:N] == S[((N+3)//2)-1:N][::-1]:
            print("Yes")
            sys.exit()


print("No")
Buggy code:
S = list(input())
N = len(S)
flag = True
if N == 3: flag = False
for i in range((N-1)//4):
    if S[i] == S[(N-1)//2-1] and S[(N+3)//2-1] == S[N-1-i]:
        print(S[i],S[(N-1)//2-1] ,S[(N+3)//2-1],S[N-1-i])
        continue
    else:
        flag = False
        break

print("Yes" if flag else "No")

Fixed code:
S = list(input())
N = len(S)
flag = True

for i in range((N-1)//4):
    if S[i] == S[(N-1)//2-1-i] and S[(N+3)//2-1+i] == S[N-1-i]:
        continue
    else:
        flag = False
        break

for i in range((N-1)//2):
    if S[i] != S[N-1-i]:
        flag = False
        break

print("Yes" if flag else "No")
Buggy code:
s = input()
len_s = len(s)
if s[:int((len_s-1)/2)] != s[int((len_s-1)/2+1):]:
    print('No')
else:
    tmp = s[:int((len_s-1)/2)]
    if len(tmp) == 1:
        print('Yes')
    else:
        if len(tmp)%2 == 1:
	        if tmp[:int((len(tmp) - 1) / 2)] == tmp[int((len(tmp) - 1) / 2 + 1):][::-1]:
            	print('Yes')
        	else:
            	print('No')
        else:
            if tmp[:int(len(tmp) / 2)] == tmp[int(len(tmp) / 2):][::-1]:
            	print('Yes')
        	else:
            	print('No')
          


Fixed code:

s = input()
len_s = len(s)
if s[:int((len_s-1) /2)] != s[int((len_s-1) / 2 +1):]:
    print('No')
else:
    tmp = s[:int((len_s -1 ) /2)]
    if len(tmp) == 1:
        print('Yes')
    else:
        if len(tmp ) %2 == 1:
            if tmp[:int((len(tmp) - 1) / 2)] == tmp[int((len(tmp) - 1) / 2 + 1):][::-1]:
                print('Yes')
            else:
                print('No')
        else:
            if tmp[:int(len(tmp) / 2)] == tmp[int(len(tmp) / 2):][::-1]:
                print('Yes')
            else:
                print('No')
Buggy code:
S = input()
N = len(S)
Sd = S[:(N-1)//2]
Sdd = S[(N+1)//2:N]
print(Sd,Sdd)
if S == S[::-1] and Sd == Sd[::-1] and Sdd == Sdd[::-1]:
    print("Yes")
else:
    print("No")

Fixed code:
S = input()
N = len(S)
Sd = S[:(N-1)//2]
Sdd = S[(N+1)//2:N]
if S == S[::-1] and Sd == Sd[::-1] and Sdd == Sdd[::-1]:
    print("Yes")
else:
    print("No")
Buggy code:
s=input()
n=len(s)
if s[::1] == s[::-1] and s[:((n-1)//2):1]==s[:((n-1)//2):-1] and s[((n+3)//2)-1:n:1]==s[((n+3)//2)-1:n:-1]:
    print('Yes')
else:
    print('No')

Fixed code:
s = input()
n = len(s)
if s == s[::-1] and \
    s[:int((n-1)/2):] == s[int((n-1)/2-1)::-1] and \
    s[int((n+3)/2-1):] == s[:int((n+1)/2-1):-1]:
    print("Yes")
else:
    print("No")
Buggy code:
s = input()
for i in [s, s[:len(s)], s[len(s)+1:]]:
  if i != i[::-1]:
    print("No")
  break
else:
  print("Yes")

Fixed code:
s = input()
for i in [s, s[:len(s)//2], s[len(s)//2+1:]]:
  if i != i[::-1]:
    print("No")
    break
else:
  print("Yes")
Buggy code:
s = input()
n = len(s)
if (s == s[::-1]
    and s[:(n-1)//2] == s[:(n-1)//2:-1]
    and s[(n+3)//2:] == s[(n+3)//2::-1]):
  print('Yes')
else:
  print('No')
  

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

t = s[:(n-1)//2]
u = s[(n+3)//2-1:]

if (s == s[::-1]
    and t == t[::-1]
    and u == u[::-1]):
  print('Yes')
else:
  print('No')
Buggy code:
s = input()
c = int((len(s) - 1)/2)
ans = (list(s) == list(reversed(s) and list(s[:c]) == list(reversed(s[:c])) and list(s[(c+1):]) == list(reversed(s[(c+1):])))
print(["No", "Yes"][ans])

Fixed code:
s = input()
c = int((len(s) - 1)/2)
ans = (list(s) == list(reversed(s)) and list(s[:c]) == list(reversed(s[:c])) and list(s[(c+1):]) == list(reversed(s[(c+1):])))
print(["No", "Yes"][ans])
Buggy code:
from sys import stdin
r = stdin.readline

def is_palin(t):
    ans, n = True, len(t)
    for i in range((n//2)+1):
        if t[i]!=t[n-i-1]: ans=False; break
    return ans

def main():
    t = r().strip()
    n = len(t)
    print(t[:((n-1)//2)], t[(n+2)//2:])
    print("Yes" if is_palin(t) and is_palin(t[:((n-1)//2)]) and is_palin(t[(n+2)//2:]) else "No") 

main()

Fixed code:
from sys import stdin
r = stdin.readline

def is_palin(t):
    ans, n = True, len(t)
    for i in range((n//2)+1):
        if t[i]!=t[n-i-1]: ans=False; break
    return ans

def main():
    t = r().strip()
    n = len(t)
    print("Yes" if is_palin(t) and is_palin(t[:((n-1)//2)]) and is_palin(t[(n+2)//2:]) else "No") 

main()
Buggy code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# FileName: 	B
# CreatedDate:  2020-03-22 20:59:36 +0900
# LastModified: 2020-03-22 21:24:32 +0900
#


import os
import sys


def main():
    S = input()
    N = len(S)
    S_b = S[:(N-1)//2]
    S_a = S[(N+3)//2:]
    for i in range((N+1)//2-1):
        if S[i]!=S[-(i+1)]:
            print("No")
            return 
    for i in range((len(S_b)+1)//2):
        if S_b[i]!=S_b[-(i+1)]:
            print("No")
            return 
    for i in range((len(S_a)+1)//2):
        if S_a[i]!=S_b[-i]:
            print("No")
            return 
    print("Yes")



if __name__ == "__main__":
    main()


Fixed code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# FileName: 	B
# CreatedDate:  2020-03-22 20:59:36 +0900
# LastModified: 2020-03-22 22:25:25 +0900
#


import os
import sys


def main():
    S = input()
    N = len(S)
    S_b = S[:(N-1)//2]
    S_a = S[(N+1)//2:]
    for i in range((N+1)//2-1):
        if S[i]!=S[-(i+1)]:
            print("No")
            return 
    for i in range((len(S_b)+1)//2):
        if S_b[i]!=S_b[-(i+1)]:
            print("No")
            return 
    for i in range((len(S_a)+1)//2):
        if S_a[i]!=S_b[-(i+1)]:
            print("No")
            return 
    print("Yes")



if __name__ == "__main__":
    main()
Buggy code:
S = input()
N= len(S)
S1=S[:(N-1)//2]
S2=S[(N+1)//2:]

def solve(s):
    if s == s[::-1]:
        return True
    return False

print(S,S1,S2)
if solve(S) and solve(S1) and solve(S2):
    print("Yes")
else:
    print("No")

Fixed code:
S = input()
N= len(S)
S1=S[:(N-1)//2]
S2=S[(N+1)//2:]

def solve(s):
    if s == s[::-1]:
        return True
    return False

if solve(S) and solve(S1) and solve(S2):
    print("Yes")
else:
    print("No")