qyliang/CodeNanoFix huggingface dataset:
Buggy code:
import math

def jds(strin):
    js = 0
    newSt = strin[::-1]
    if strin == newSt:
        js +=1
    return js
 
a = input()
jud = 0

leee = len(a)

if leee % 2 == 0:
    b = a[:math.ceil((len(a) - 1) / 2)]
    c = a[math.floor((len(a) + 1) / 2):]
else:
    b = a[:int((len(a) - 1) / 2)]
    c = a[int((len(a) + 2) / 2):]
 
jud += jds(a) + jds(b) + jds(c)
 
print(jud)
if jud == 3:
    print("Yes")
else:
    print("No")

Fixed code:
import math

def jds(strin):
    js = 0
    newSt = strin[::-1]
    if strin == newSt:
        js +=1
    return js
 
a = input()
jud = 0

leee = len(a)

if leee % 2 == 0:
    b = a[:math.ceil((len(a) - 1) / 2)]
    c = a[math.floor((len(a) + 1) / 2):]
else:
    b = a[:int((len(a) - 1) / 2)]
    c = a[int((len(a) + 2) / 2):]
 
jud += jds(a) + jds(b) + jds(c)
 
#print(jud)
if jud == 3:
    print("Yes")
else:
    print("No")
Buggy code:
s = input()
a=1
for i in range(len(s)):
  if(s[i]!=s[-i-1]):
    a=0
    break
for i in range((len(s)-1)//2):
  if(s[i]!=s[(len()-3)//2]):
    a=0
if(a==1):
  print("Yes")
else:
  print("No")

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

t1 = s1[0 : (len(s1)) // 2]
t2 = ''
for i in range(len(t1)):
    t2 += t1[- i - 1]
if t1 != t2:
    print('No2')
    exit() 

u1 = s1[(len(s1) + 3) // 2 + 1::]
u2 = ''
for i in range(len(u1)):
    u2 += u1[- i - 1]
if u1 != u2:
    print('No3')
    exit() 
print('Yes')

Fixed code:
s1 = str(input())
s2 = ''
for i in range(len(s1)):
    s2 += s1[- i - 1]
if s1 != s2:
    print('No')
    exit()

t1 = s1[0 : ((len(s1)) - 1) // 2]
t2 = ''
for i in range(len(t1)):
    t2 += t1[- i - 1]
if t1 != t2:
    print('No')
    exit() 

u1 = s1[(len(s1) + 3) // 2 - 1:]
u2 = ''
for i in range(len(u1)):
    u2 += u1[- i - 1]
if u1 != u2:
    print('No')
    exit() 
print('Yes')
Buggy code:
A = list(input())
A1 = reversed(A)

B = A[0:(len(A)-1)/2-1]
B1 = reversed(B)

C = A[(len(A)+3)/2-1:-1]
C1 = reversed(C)

if A == A1 and B == B1 and C == C1:
    print("Yes")
else:
    print("No")

Fixed code:
A = list(input())
A1 = list(reversed(A))
#print((len(A)-1)/2-1)
 
B = A[:(len(A)-1)//2]
B1 = list(reversed(B))
 
C = A[(len(A)+3)//2-1:]
C1 = list(reversed(C))
 
if A == A1 and B == B1 and C == C1:
    print("Yes")
else:
    print("No")
Buggy code:
S = str(input())
N = len(S)
B = S[:((N-1)/2)]
C = S[((N+3)/2):]
if S == S[-1]:
    if S[:((N-1)/2)] == B[-1]:
        if C[-1] == S[((N+3)/2):]:
            print("Yes")
        else:
            print("No")
    else:
            print("No")
else:
            print("No")

Fixed code:
S = str(input())
N = int(len(S))
B = S[:(N-1)//2]
C = S[(((N+3)//2)-1):]

if S == S[::-1]:
    if B == B[::-1]:
        if C[::-1] == C:
            print("Yes")
        else:
            print("No")
    else:
            print("No")
else:
            print("No")
Buggy code:
n = input()
a = (len(n) - 1)//2
b = (len(n) + 3)//2
if n == n[::-1]:
  if n[0:a-1] == n[0:a-1:-1]:
    if n[b-1:len(n)-1] == n[b-1:len(n)-1:-1]:
      print("Yes")
  	else:
      print("No")
  else:
    print("No")
else:
  print("No")
    

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

x = int((N-1)/2)
y = int((N+3)/2)

a = str(S[:x])
b = str(S[y:N])

reverse_a = ''.join(list(reversed(a)))
reverse_b = ''.join(list(reversed(b)))

if str(a) == str(reverse_a) and str(b) == str(reverse_b):
  print('Yes')
else:
  print('No')

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

x = int((N-1)/2)
y = int((N+3)/2)

a = str(S[:x])
b = str(S[y:N-1])

reverse_S = ''.join(list(reversed(S)))
reverse_a = ''.join(list(reversed(a)))
reverse_b = ''.join(list(reversed(b)))

if str(S) == str(reverse_S) and str(a) == str(reverse_a) and str(b) == str(reverse_b):
  print('Yes')
else:
  print('No')
Buggy code:
S = input()
s1 = S[:(N-1)//2]
s2 = S[(N+3)//2-1:]

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[:(N-1)//2]
s2 = S[(N+3)//2-1:]

if S == S[::-1] and s1 == s1[::-1] and s2 == s2[::-1]:
  print("Yes")
else:
  print("No")
Buggy code:
def main():
	# s = int(input())
	s = str(input())
	s_1_mae = list(s[:((len(s)-1) // 2)])

	s_2 = list(s[((len(s)+3)// 2) -1 :])

	if s_1_mae == list(reversed(s_1_mae)) and s_2 == list(reversed(s_2)) and list(s) == reversed(list(s)):
		print("Yes")
	else:
		print("No")

if __name__ == '__main__':
	main()

Fixed code:
def main():
	s = str(input())
	s_1_mae = list(s[:((len(s)-1) // 2)])

	s_2 = list(s[((len(s)+3)// 2) -1 :])

	if s_1_mae == list(reversed(s_1_mae)) and s_2 == list(reversed(s_2)) and list(s) == list(reversed(list(s))):
		print("Yes")
	else:
		print("No")

if __name__ == '__main__':
	main()
Buggy code:
s = [i for i in input()]
len_s = len(s)

def reverse(s):
  rev = [j for j in s[::-1]]
  return rev

if s == reverse(s):
  if reverse(s[:(len_s - 1)//2]) == s[:(len_s - 1)//2] and reverse(s[(len_s + 3)//2 - 1:]) == s[(len_s + 3)//2 - 1:]:
    print("Yes")
else:
  print("No")

Fixed code:
s = [i for i in input()]
len_s = len(s)

def reverse(s):
  rev = [j for j in s[::-1]]
  return rev

if s == reverse(s):
  if reverse(s[:(len_s - 1)//2]) == s[:(len_s - 1)//2] and reverse(s[(len_s + 3)//2 - 1:]) == s[(len_s + 3)//2 - 1:]:
    print("Yes")
  else:
    print("No")
else:
  print("No")
Buggy code:
#!/usr/bin/env python3

import copy

s = list(str(input()))
N = len(s)


def disc(s):
    s1 = s[:len(s)//2]
    s2 = s[len(s)//2+1:]
    s2.reverse()

    if s1 == s2:
        return True
    else:
        return False


print(s)
print(s[:(N-1)//2])
print(s[(N+3)//2-1:])

if disc(s) and disc(s[:(N-1)//2]) and disc(s[(N+3)//2-1:]):
    print("Yes")
else:
    print("No")


Fixed code:
#!/usr/bin/env python3

s = list(str(input()))
N = len(s)


def disc(s):
    s1 = s
    s2 = s[:]
    s2.reverse()
    if s1 == s2:
        return True
    else:
        return False


if disc(s) and disc(s[:(N-1)//2]) and disc(s[(N+3)//2-1:]):
    print("Yes")
else:
    print("No")
Buggy code:
S = input()
N = len(S)
kai = []
kai2 = []
kai3 = []

for i in range(N):
  kai.append(S[i])

for i in range(1, ((N - 1) / 2 + 1)):
  kai2.append(S[i])

for i in range(((N + 3) / 2), N + 1):
  kai3.append(S[i])

rev = kai.reverse
rev2 = kai2.reverse
rev3 = kai3.reverse

if kai == rev:
  if kai2 = rev2:
    if kai3 = rev3:
      print('Yes')
    else:
      print('No')
  else:
    print('No')
else:
  print('No')

Fixed code:
S = input()
N = len(S)
kai = []
kai2 = []
kai3 = []
rev = []
rev2 = []
rev3 = []

for i in range(N):
  kai.append(S[i])

for i in range(0, int((N - 1) / 2)):
  kai2.append(S[i])

for i in range(int((N + 3) / 2) - 1, N):
  kai3.append(S[i])

kai.reverse()
kai2.reverse()
kai3.reverse()

for i in range(N):
  rev.append(S[i])

for i in range(0, int((N - 1) / 2)):
  rev2.append(S[i])

for i in range(int((N + 3) / 2) - 1, N):
  rev3.append(S[i])

if kai == rev:
  if kai2 == rev2:
    if kai3 == rev3:
      print('Yes')
    else:
      print('No')
  else:
    print('No')
else:
  print('No')
Buggy code:
# class Solution:
#     def solve(self, a, b, c, s):
#         return str(a + b + c) + " " + s


def main():
    inp = lambda: [int(x) for x in input().split()]
    s = input()
    n = (len(s)) // 2
    is_paliny = lambda a: a == a[::-1]
    ans = "YES" if is_paliny(s) and is_paliny(s[:n]) else "NO"
    print(ans)


if __name__ == '__main__':
    main()



Fixed code:
# class Solution:
#     def solve(self, a, b, c, s):
#         return str(a + b + c) + " " + s


def main():
    inp = lambda: [int(x) for x in input().split()]
    s = input()
    n = (len(s)) // 2
    is_paliny = lambda a: a == a[::-1]
    ans = "Yes" if is_paliny(s) and is_paliny(s[:n]) else "No"
    print(ans)


if __name__ == '__main__':
    main()
Buggy code:
s = input()
n = len(s)//2
print('Yes' if s[:n]==s[n+1:][::-1] else 'No')

Fixed code:
s = input()
n = (len(s)-1)//2
print('Yes' if s[:n]==s[n+1:] else 'No')
Buggy code:
s = input()
n = len(s)
def is_kai(s):
    for i in range(int(len(s)/2)):
        if s[i] != s[-i-1]:
            return False
        return True
if is_kai(s) and is_kai(s[:int((n-1)/2)]) and is_kai(s[int((n+3)/2):]):
    print('Yes')
else:
    print('No')

Fixed code:
s = input()
n = len(s)
def is_kai(s):
    for i in range(int((len(s))/2)):
        if s[i] != s[-i-1]:
            return False
    return True
if is_kai(s) and is_kai(s[:int((n-1)/2)]):
    print('Yes')
else:
    print('No')
Buggy code:

def f(x):
	return x == x[::-1]
S = input()
l = len(S)
S1 = S[:((l-1)//2)]
S2 = S[((l+3)//2):]
if f(S) and f(S1) and f(S2):
	print("Yes")
else:
	print("No")

Fixed code:

def f(x):
	return x == x[::-1]
S = input()
l = (len(S)-1)//2
S1 = S[:l]
S2 = S[l+1:]
if f(S) and f(S1) and f(S2):
	print("Yes")
else:
	print("No")
Buggy code:
# n,m = map(int, input().split())
s = input()

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

# print(f,b)

if s != s[::-1] or s[:f] != s[:f:-1] or s[b:] != s[b:][::-1]: 
  # print(s[::-1])
  print("No")

# if :
#   print(s[:f:-1])
#   print("No")

# if :
#   print(b,":",s[b:][::-1])
#   print("No")

print("Yes")



Fixed code:
# n,m = map(int, input().split())
s = input()

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

# print(f,b)

if s != s[::-1] or s[:f] != s[:f:-1] or s[b:] != s[b:][::-1]: 
  # print(s[::-1])
  print("No")
else: 
  print("Yes")

# if :
#   print(s[:f:-1])
#   print("No")

# if :
#   print(b,":",s[b:][::-1])
#   print("No")
Buggy code:
import math
s = list(input())
n = int(len(s))
s1 = s[ : int((n-1)/2)]
s2 = s[int((n+3) / 2) - 1 : n]
print(s1)
print(s2)
flag = 0
print(int(len(s1)))
for i in range(int(len(s1) / 2)):
    if s1[i] == s1[int(len(s1)) - i - 1]:
        flag = 1
    else:
        break

for i in range(int(len(s2) / 2)):
    if s2[i] == s2[int(len(s2)) - i - 1]:
        flag = 1
    else:
        break

print('Yes' if flag == 1  else 'No')

Fixed code:
import math
s = list(input())
n = len(s)
s1 = s[ : (n-1) // 2]
s2 = s[(n+3) // 2 - 1 : n]
flag = 1

for i in range(len(s) // 2):
    if s[i] != s[- i - 1]:
        flag = 0

for i in range(len(s1) // 2):
    if s1[i] != s1[- i - 1]:
        flag = 0

for i in range(len(s2) // 2):
    if s2[i] != s2[- i - 1]:
        flag = 0

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

Fixed code:
s=list(input())
n=len(s)
zenhan=s[0:int((n-1)/2)]
kouhan=s[int((n+3)/2-1):n]
if s==s[::-1] and zenhan==zenhan[::-1] and kouhan==kouhan[::-1]:
  print('Yes')
else:
  print('No')
Buggy code:
s = input()
p = len(s) - 1 // 2
t = s[:p]
u = s[p+1:]

res = s == s[::-1] and t == t[::-1] and u == u[::-1]

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


Fixed code:
s = input()
p = (len(s) - 1) // 2
t = s[:p]
u = s[p+1:]

res = s == s[::-1] and t == t[::-1] and u == u[::-1]

print("Yes" if res else "No")
Buggy code:
s = input()
def isPalindrome(string):
    return s == s[::-1]
if isPalindrome(s) and isPalindrome(s[:len(s)//2]):
    print('Yes')
else:
    print('No')


Fixed code:
s = input()
def isPalindrome(string):
    return string == string[::-1]
if isPalindrome(s) and isPalindrome(s[0:len(s)//2]):
    print('Yes')
else:
    print('No')
Buggy code:
s = input()
n = len(s)
a = s[:n//2]
b = s[n//2+1:]


def circular(string):
    return s == s[::-1]
if circular(s) and circular(a):
    print('Yes')
else:
    print('No')


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

def circular(string):
    return string == string[::-1]
if circular(s) and circular(a):
    print('Yes')
else:
    print('No')
Buggy code:
s=input()
c=0
n=int(len(s))
for i in range(n):
  if (s[i]!=s[n-i-1]):
    c+=1
    print("No")
    break
for i in range((n-1)//2):  
  if s[i]!=s[(n-3)//2-i]:
    c+=1
    print("No")
    break
  if s[(n+1)//2+i]!=s[n-i-1]:
    c+=1
    print("No")
    break
if c==0:
  print("Yes")

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

import math

s = input()
list = list(s)


num = math.floor(len(s)/2)
count = 0


if len(s) == 3:
    if list[0] == list[2]:
        print("Yes")
    else:
        print("No")
else:
    for i in range(num - 1):
        if list[i] == list[len(s) - 1 - i]:
            count += 1
        else:
            print("No")
            break

if len(s) == 3:
    None
else:
    if count == num - 1:
        print("Yes")
    else:
        None


Fixed code:
import math

s = input()
list = list(s)


num = math.floor(len(s)/2)
count = 0


if len(s) == 3:
    if list[0] == list[2]:
        print("Yes")
    else:
        print("No")


else:
    
    for i in range(num):
        if list[i] == list[num+1+i]:
            count += 1
        else:
            print("No")
            break

if len(s) == 3:
    None
else:
    if count == num:
        print("Yes")
    else:
        None
Buggy code:
S=input()
cnt=0

L=int((len(S)-1)/2)
#print(L)
for i in range(L):
    #print(S[i])
    #print(S[-(i+1)])
    if S[i]==S[-(i+1)]:
        cnt+=1
        
if cnt==L:
    S=S[0:L]
    cnt=0
    #print(S)
    L=int((len(S)-1)/2)
    #print(L)
    for i in range(L):
        #print(S[i])
        #print(S[-(i+1)])
        if S[i]==S[-(i+1)]:
            cnt+=1
    #print(cnt)
    #print(L)
    if cnt==L:
        print('Yes')
    else:
        print('No')
        
else:
    print('No')

Fixed code:
S=input()
cnt=0

L=int((len(S)-1)/2)
#print(L)

for i in range(L):
    #print(S[i])
    #print(S[-(i+1)])
    if S[i]==S[-(i+1)]:
        cnt+=1

if cnt!=L:
    print('No')
    exit()

S=S[0:L]
#print(S)

cnt=0
LEN=len(S)
for i in range(LEN):
    if S[i] == S[LEN-(i+1)]:
        cnt+=1

if cnt==LEN:
    print('Yes')
else:
    print('No')
Buggy code:
def resolve():
    def is_rotatable(S):
        print(S)
        for i in range(len(S)//2):
            if S[i] != S[-1-i]:
                return False
        return True
    S = input()
    N = len(S)
    if is_rotatable(S) and is_rotatable(S[:N//2]) and is_rotatable(S[(N//2)+1:]):
        print("Yes")
    else:
        print("No")


if '__main__' == __name__:
    resolve()

Fixed code:
def resolve():
    def is_rotatable(S):
        for i in range(len(S)//2):
            if S[i] != S[-1-i]:
                return False
        return True
    S = input()
    N = len(S)
    if is_rotatable(S) and is_rotatable(S[:N//2]) and is_rotatable(S[(N//2)+1:]):
        print("Yes")
    else:
        print("No")


if '__main__' == __name__:
    resolve()
Buggy code:
S = input()

def kaibun(x):
    N = len(x)
    flag = True
    for i in range(N // 2):
        if S[i] != S[-i - 1] or N < 3:
            flag = False
    return flag

tmp1 = kaibun(S)
tmp2 = kaibun(S[:(len(S) - 1) // 2])
tmp3 = kaibun(S[(len(S) + 3) // 2:])

if tmp1 and tmp2 and tmp3:
    print('Yes')
else:
    print('No')


        


Fixed code:
S = input()

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

tmp1 = kaibun(S)
tmp2 = kaibun(S[:(len(S) - 1) // 2])
tmp3 = kaibun(S[(len(S) + 3) // 2 - 1:])


if tmp1 and tmp2 and tmp3:
    print('Yes')
else:
    print('No')
Buggy code:
s=input()
n=len(s)
if s[:(n-1)/2-1]==s[:(n-1)/2-1][::-1] and s==s[::-1]:
  print('Yes')
else:
  print('No')

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

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

num = len(S)
S1 = S[:(num-1)/2]
S2 = S[(num+3)/2:]

if S == S[::-1] and S1 == [::-1] and S2 == [::-1]:
  print('Yes')
else:
  print('No')

Fixed code:
S = input()

num = len(S)
S1 = S[:(num-1)//2]
S2 = S[(num+1)//2:]

if S == S[::-1] and S1 == S1[::-1] and S2 == S2[::-1]:
  print('Yes')
else:
  print('No')
Buggy code:
S=str(input())
N=len(S)
p=0
a=0
c=0


for i in range(int((N-1)/2)):
        if S[i]==S[-i-1]:
            p+=1
if p==(N-1)/2:
    for i in range(int((N-1)/4)):
        T=S[:int((N-1)/2)]
        if T[i]==T[-i-1]:
                a+=1
    if a==int((N-1)/4):

        for y in range(int((N-(N+3)/2)/2)):

            F=S[int((N+3)/2)-1:]

            if F[y]==F[-y-1]:
                c+=1
        if c==(int((N-(N+3)/2)/2)):
            print("yes")
        else:
            print("No")


    else:
        print("No")


else:
    print("No")


Fixed code:
S=str(input())
N=len(S)
p=0
a=0
c=0
for i in range(int((N-1)/2)):
        if S[i]==S[-i-1]:
            p+=1
if p==(N-1)/2:
    for i in range(int((N-1)/4)):
        T=S[:int((N-1)/2)]
        if T[i]==T[-i-1]:
                a+=1
    if a==int((N-1)/4):
        for y in range(int((N-(N+3)/2)/2)):
            F=S[int((N+3)/2)-1:]
            if F[y]==F[-y-1]:
                c+=1
        if c==(int((N-(N+3)/2)/2)):
            print("Yes")
        else:
            print("No")
    else:
        print("No")
else:
    print("No")
Buggy code:
s = input()
n = len(s)
count = 0
halfn = int((n-1) / 2)
whalfn = int((n-1) / 4)
half = s[0:halfn]

for i in range(len(s)):
    if s[i] != s[-i-1]:
      count += 1
      break
    else:
      pass



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

Fixed code:
s = input()
n = len(s)
count = 0
halfn = int((n-1) / 2)
whalfn = int((n-1) / 4)
half = s[0:halfn]

for i in range(len(s)):
    if s[i] != s[-i-1]:
      count += 1
      break
    else:
      pass

for i in range(len(half)):
  if half[i] != half[-i-1]:
    count += 1
    break
  else:
    pass

if count == 0:
  print('Yes')
else:
  print('No')
Buggy code:
S = input()
N = len(S)
def f(s):
    for i in range((N-1)//2):
        if s[i] != s[N-i-1]:
            return False
    for i in range(((N-1)//2-1)//2):
        if s[i+(N//2)+1] != s[N-i-1]:
            return False
    return True

if f(S):
    print("Yes")
else:
    print("No")

Fixed code:
S = input()
N = len(S)
def f(s):
    n = len(s)
    for i in range((n-1)//2+1):
        if s[i] != s[n-i-1]:
            return False
    return True

if f(S) and f(S[:(N-1)//2]):
    print("Yes")
else:
    print("No")
Buggy code:
import math
s = str(input())
m = (len(s) - 1) / 2
c = True
for i in range(math.floor(m / 2)):
    if s[i] != s[int(m-1-i)]:
        c = False
for i in range(math.floor(m / 2)):
    if s[int(m+1+i)] != s[int(len(s)-1-i)]:
        c = False
for i in range(math.floor(m)):
    if s[i] != s[int(math.floor(len(s)-1))]:
        c = False
if c:
    print("Yes")
else:
    print("No")

Fixed code:
import math
s = str(input())
m = (len(s) - 1) / 2
c = True
for i in range(math.floor(m / 2)):
    if s[i] != s[int(m-1-i)]:
        c = False
for i in range(math.floor(m / 2)):
    if s[int(m+1+i)] != s[int(len(s)-1-i)]:
        c = False
for i in range(math.floor(m)):
    if s[i] != s[int(math.floor(len(s)-1-i))]:
        c = False
if c:
    print("Yes")
else:
    print("No")
Buggy code:
import sys

S=str(input())
N=len(S)

N1=int((N-1)/2)
N2=int((N+3)/2-1)

S1=list(S[:N1])
S2=list(S[N2:])


S3=list(reversed(S1))
S4=list(reversed(S2))
Sr=list(reversed(S))

if S==Sr:
    if S1==S3:
        if S2==S4:
            print("Yes")
            sys.exit()
print("No")

Fixed code:
import sys

S=list(str(input()))
N=len(S)

N1=int((N-1)/2)
N2=int((N+3)/2-1)

S1=list(S[:N1])
S2=list(S[N2:])


S3=list(reversed(S1))
S4=list(reversed(S2))
Sr=list(reversed(S))

if S==Sr:
    if S1==S3:
        if S2==S4:
            print("Yes")
            sys.exit()
print("No")
Buggy code:
def kaibun(s):
    flg = False
    if len(s) % 2 == 0:
        if s[0:int((len(s)/2)-1)] == s[int(len(s)/2):len(s)-1:-1]:
            flg =True
    else:
        if s[0:int((len(s)-1)/2-1)] == s[int((len(s)+1)/2):len(s)-1:-1]:
            flg =  True
    return flg



s = input()
ans = "No"



if kaibun(s):
    if kaibun(s[0:int((len(s)-1)/2-1)]) and kaibun(s[int((len(s)+1)/2):len(s)-1]):
        ans = "Yes"
print(ans)

Fixed code:
def kaibun(s):
    flg = False
    if len(s) % 2 == 0:
        if s[0:int((len(s)/2))] == s[int(len(s)/2):len(s)][::-1]:
            flg =True
    else:
        
        if s[0:int((len(s)-1)/2)] == s[int((len(s)+1)/2):len(s)][::-1]:
            flg =  True
    return flg



s = input()
ans = "No"



if kaibun(s):
    if kaibun(s[0:int((len(s)-1)/2)]) and kaibun(s[int((len(s)+1)/2):len(s)]):
        ans = "Yes"
print(ans)
Buggy code:
s=input()
if len(s) % 2 == 0:
	print('No')
else:
	n=(len(s)-1)//2
	if s[:n] == s[n+1:]:
		print('Yes')

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

print(S[:(N-1)//2])
print(S[(N+2)//2:])

if S[:(N-1)//2] == S[(N+2)//2:]:
  print('Yes')
else:
  print('No')

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

if S[:(N-1)//2] == S[(N+2)//2:]:
  print('Yes')
else:
  print('No')
Buggy code:
s = input()
m = (len(s) - 1) / 2
l = s[:m]
r = s[(len(s) + 3) / 2 - 1:]


def check(s):
    mid = len(s) // 2
    left = s[:mid]
    right = s[mid+1:]
    if left == right[::-1]:
        return True
    else:
        return False

if check(s) and check(r) and check(l):
    print("Yes")
else:
    print("No")


Fixed code:
s = input()
m = (len(s) - 1) // 2
l = s[:m]
r = s[(len(s) + 3) // 2 - 1:]


def check(s):
    mid = len(s) // 2
    if len(s) % 2 != 0:
        left = s[:mid]
        right = s[mid+1:]
    else:
        left = s[:mid]
        right = s[mid:]
    if left == right[::-1]:
        return True
    else:
        return False

if check(s) and check(r) and check(l):
    print("Yes")
else:
    print("No")
Buggy code:
a=int(input())
c=len(a)
b=a[:(c-1)//2]
d=a[(c+3)//2:]
if a==a[::-1] and b==b[::-1] and d==d[::-1]:
  print("Yes")
else:
  print("No")

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

def kaibun(st):
  sta = list()
  for k in range(len(st)//2):
    sta.append(st[k])
  for k in range(len(st)//2):
    if st[-(-len(st)//2)+k] != sta.pop():
      return False
  return True

if kaibun(s) == False:
  print('False')
elif kaibun(s[:(n-1)//2]) == False:
  print('False')
elif kaibun(s[(n+3)//2-1:]) == False:
  print('False')
else:
  print('True')


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

def kaibun(st):
  sta = list()
  for k in range(len(st)//2):
    sta.append(st[k])
  for k in range(len(st)//2):
    if st[-(-len(st)//2)+k] != sta.pop():
      return False
  return True

if kaibun(s) == False:
  print('No')
elif kaibun(s[:(n-1)//2]) == False:
  print('No')
elif kaibun(s[(n+3)//2-1:]) == False:
  print('No')
else:
  print('Yes')