qyliang/CodeNanoFix huggingface dataset:
Buggy code:
# -*- coding: utf-8 -*-

def _index(l, c):
    if c in l:
        return l.index(c)
    else:
        return -1

chars = list(input())

a = _index(chars, "A")
z = _index(list(reversed(chars)), "Z")

if a == -1 or z == -1:
    print("0")
    exit(0)

if a < z:
    print(len(chars) - a - z)
else:
    print("0")

Fixed code:
# -*- coding: utf-8 -*-

def _index(l, c):
    if c in l:
        return l.index(c)
    else:
        return -1

chars = list(input())

a = _index(chars, "A")
z = _index(list(reversed(chars)), "Z")
# print("{}, {}".format(a, z))

if a == -1 or z == -1:
    print("0")
    exit(0)

if a + z < len(chars) - 1:
    print(len(chars) - a - z)
else:
    print("0")
Buggy code:
S = input()
A = S.index('A')
Z = S[::-1].index('Z')
print(len(S[A:-Z]))

Fixed code:
S = input()
print(len(S) - S.index('A') - S[::-1].index('Z'))
Buggy code:
import re

letter = str(input())
pattern = 'A(.*)Z'
target = re.search(pattern, letter).group()
print(target)

Fixed code:
import re

letter = str(input())
pattern = 'A(.*)Z'
target = re.search(pattern, letter).group()
print(len(target))
Buggy code:
s = input()
t = 0
u = 0
n = len(s)
for i in range(n):
  if s[i] == "A":
    t = i
    break
for j in range(n):
  if s[n-j] == "Z":
    u = n-j
print(u-t)

Fixed code:
s = input()
t = 0
u = 0
n = len(s)
for i in range(n):
  if s[i] == "A":
    t = i
    break
for j in range(n):
  if s[n-j-1] == "Z":
    u = n-j-1
    break
print(u-t+1)
Buggy code:

s = list(input())
n = len(s)
l = 0
r = 0
ans = 0

for i in range(len(s)):
    if s[i] == "A":
        l = i
        break

for i in range(n-1,i,-1):
    if s[i] == "Z":
        r = i+1

ans = max(0,r-l)
print(ans)


Fixed code:

s = input()
n = len(s)
for i in range(n):
    if s[i] == "A":
        l = i
        break

for i in range(n-1,i,-1):
    if s[i] == "Z":
        r = i+1
        break

ans = max(0,r-l)
print(ans)
Buggy code:
s = input()

idx_a = None
idx_b = 0

for idx, char in enumerate(s):
    if char =='A' and idx_a:
        idx_a = idx
    if char == 'Z':
        idx_b = idx

print(idx_b - idx_a + 1)


Fixed code:
s = input()

idx_a = None
idx_b = 0

for idx, char in enumerate(s):
    if char =='A' and idx_a is None:
        idx_a = idx
    if char == 'Z':
        idx_b = idx

print(idx_b - idx_a + 1)
Buggy code:
s=list(input())
a=0
z=0

print(len(s))

for i in range(len(s)):
  if s[i]=="A":
      a=i
      break

print(a)

S=list(reversed(s))
for j in range(len(S)):
    if S[j]=="Z":
        z=j
        break
print(z)

print(len(s)-a-z)

Fixed code:
s=list(input())
a=0
z=0

for i in range(len(s)):
  if s[i]=="A":
      a=i
      break

S=list(reversed(s))
for j in range(len(S)):
    if S[j]=="Z":
        z=j
        break

print(len(s)-a-z)
Buggy code:
s = input()

for i in range(len(s)):
    if s[i] == 'A':
        a_index = i

for j in range(-1, -(len(s)-a_index), -1):
    if s[j] == 'Z':
        z_index = j

length = (len(s) + z_index) - a_index + 1
print(length)


Fixed code:
s = input()

for i in range(len(s)):
    if s[i] == 'A':
        a_index = i
        break

for j in range(-1, -(len(s)-a_index), -1):
    if s[j] == 'Z':
        z_index = j
        break

length = (len(s) + z_index) - a_index + 1
print(length)
Buggy code:
S = input()
N = len(S)
for i in range(N):
    if S[i] == 'A':
        a_index = i
        break
for i in range(N-1,-1,-1):
    if S[i] == 'Z':
        z_index = i
        break

print(N - z_index - a_index)


Fixed code:
S = input()
N = len(S)
for i in range(N):
    if S[i] == 'A':
        a_index = i
        break
S=S[::-1]
for i in range(N):
    if S[i] == 'Z':
        z_index = i
        break

print(N - z_index - a_index)
Buggy code:
from sys import stdin


if __name__ == "__main__":
    _in = [_.rstrip() for _ in stdin.readlines()]
    s =     _in[0]   # type:str
    # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
    str_ = s[s.find('A'):s.rfind('Z')+1]
    # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    print(str_)


Fixed code:
from sys import stdin


if __name__ == "__main__":
    _in = [_.rstrip() for _ in stdin.readlines()]
    s =     _in[0]   # type:str
    # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
    cnt = s.rfind('Z')-s.find('A')+1
    # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    print(cnt)
Buggy code:
s=input()

mojiA=s.index("A")
mojiZ=s.index("Z")

d=s[mojiA:mojiZ+1]

print(len(d))


Fixed code:
s=input()

mojiA=s.index("A")
mojiZ=s.rindex("Z")

d=s[mojiA:mojiZ+1]

print(len(d))
Buggy code:
s = input()
a = 0
z = -1
while 1:
    if s[a] == 'A':
        break
    a+=1
while 1:
    if s[z] =='Z':
        break
    z-=1
print(s[a:z+1])

Fixed code:
s = input()
a = 0
z = -1
while 1:
    if s[a] == 'A':
        break
    a+=1
while 1:
    if s[z] =='Z':
        break
    z-=1
print(len(s)-a+z+1)
Buggy code:
s = input()

start = s.index("A")

for i in range(start, len(s)):
    if s[i] == "Z":
        print(i - start + 1)
        break

Fixed code:
s = input()

start = s.index("A")

for i in range(len(s)-1, start, -1):
    if s[i] == "Z":
        print(i - start + 1)
        break
Buggy code:
import sys
input = sys.stdin.readline
s = input().rstrip()
s_rev = s[::-1]
mina = -1
maxz = -1
for i in range(len(s)):
    if s[i] == "A":
        mina = i
for j in range(len(s)):
    if s[j] == "Z":
        maxz = max(maxz, j)
print(maxz - mina + 1)


Fixed code:
import sys
input = sys.stdin.readline
s = input().rstrip()
s_rev = s[::-1]
mina = -1
maxz = -1
for i in range(len(s)):
    if s[i] == "A":
        mina = i
        break
for j in range(len(s)):
    if s[j] == "Z":
        maxz = max(maxz, j)
print(maxz - mina + 1)
Buggy code:
s = input()
for i in range(N):
  if s[i] == 'A':
    left = i
    break
    
for i in range(N):
  if s[N-1-i] == 'Z':
    right = N-1-i
    
print(right - left + 1)

Fixed code:
s = input()
N = len(s)
for i in range(N):
  if s[i] == 'A':
    left = i
    break
    
for i in range(N):
  if s[N-1-i] == 'Z':
    right = N-1-i
    break
    
print(right - left + 1)
Buggy code:
s = input()
end = 0
for i in range(len(s) - 1, -1, -1):
  if s[i] == 'Z':
    end = i + 1
    break
    
print(s[s.index('A'):end])

Fixed code:
s = input()
end = 0
for i in range(len(s) - 1, -1, -1):
  if s[i] == 'Z':
    end = i + 1
    break
    
print(len(s[s.index('A'):end]))
Buggy code:
s=input()
a,b=0,0
for i in range(len(s)):
  if s[i]=='A':
    a=i
    break
for j in range(len(s)-1,-1):
  if s[j]=='Z':
    b=j
    break
print(len(s[a:b+1]))

Fixed code:
s=input()
a,b=0,0
for i in range(len(s)):
  if s[i]=='A':
    a=i
    break
for j in range(len(s)-1,-1,-1):
  if s[j]=='Z':
    b=j
    break
print(len(s[a:b+1]))
Buggy code:
s=input()
ans=0
x=0
y=len(s)-1
for i in range(len(s)):
    if s[i]=='A':
        x=i
    break
for i in range(len(s)-1,0,-1):
    if s[-i]=='Z':
        y=i

print(y-x+1)

Fixed code:
s=input()
n=len(s)
x=0
y=n-1
for i in range(n):
    if s[i]=='A':
        x=i
        break
for i in range(n-1,0,-1):
    if s[i]=='Z':
        y=i
        break

print(y-x+1)
Buggy code:
Strings = input()

for i in range(0,len(Strings)):
    if Strings[i] == "A":
        length = i
        print(i)
        break

for i in range(len(Strings))[::-1]:
    if Strings[i] == "Z":
        length2 = i
        print(i)
        break

print(length2 - length +1 )

Fixed code:
Strings = input()

for i in range(0,len(Strings)):
    if Strings[i] == "A":
        length = i
        break

for i in range(len(Strings))[::-1]:
    if Strings[i] == "Z":
        length2 = i
        break

print(length2 - length +1 )
Buggy code:
s=input()

print(s.find('Z')-s.find('A')+1)

Fixed code:
s = input()

print(s.rfind("Z") - s.find("A") + 1)
Buggy code:
s = list(input())
fastA = s.index("A")
s.reverse()
lastZ = len(s) - s.index("Z")+1
print(lastZ - fastA + 1)


Fixed code:
s = list(input())
len = len(s)
fastA = s.index("A")+1
s.reverse()
Ztsal = s.index("Z")+1
lastZ = len - Ztsal + 1
print(lastZ - fastA + 1)
Buggy code:
s = list(input())
start = 0
end = 0
for i in range(len(s)):
  if s[i] == "A":
    start = i
for i in reversed(range(len(s))):
  if s[i] == "Z":
    end = i
print(end - start + 1)

Fixed code:
s = list(input())
start = 0
end = 0
len_s = len(s)
for i in range(len_s):
  if s[i] == "A":
    start = i
    break
    
for i in reversed(range(len_s)):
  if s[i] == "Z":
    end = i
    break
print(end - start + 1)
Buggy code:
s = input()

a = s.index('A')
for i in range(len(s)):
  if s[-i] == 'Z':
    z = len(s) - i

print(z - a + 1)

Fixed code:
s = input()

a = s.index('A')
z = []
for i in range(len(s)):
  if s[i] == 'Z':
    z.append(i)
    
print(max(z) - a + 1)
Buggy code:
s = input()
l = s.find('A')
r = s.rfind('Z')
ans = s[l:r+1]
print(ans)


Fixed code:
s = input()
l = s.find('A')
r = s.rfind('Z')
ans = len(s[l:r+1])
print(ans)
Buggy code:
s = input()
print((s.find('Z')-s.find('A'))+1)

Fixed code:
s = input()
print((s.rfind('Z')-s.find('A'))+1)
Buggy code:
s=input()
for i in len(s):
  if s[i] == 'A':
    a=i
    break
for i in len(s):
  if s[i] == 'Z':
    z=i
print(z-a+1)

Fixed code:
s=input()
for i in range(len(s)):
  if s[i] == 'A':
    a=i
    break
for i in range(len(s)):
  if s[i] == 'Z':
    z=i
print(z-a+1)
Buggy code:
s=input()
a=-1
z=0
for i in range(s.len()):
  if a<0 and s[i]=='A':a=i
  if s[i]=='Z':z=i
print(z-a+1)

Fixed code:
s=input()
a=-1
z=0
for i in range(len(s)):
  if a<0 and s[i]=='A':a=i
  if s[i]=='Z':z=i
print(z-a+1)
Buggy code:
for i in range(len(s)):
    if s[i]=='A':
        a=i
        break
for j in reversed(range(len(s))):
    if s[j]=='Z':
        b=j
        break
print(b-a+1)

Fixed code:
s =str(input())
for i in range(len(s)):
    if s[i]=='A':
        a=i
        break
for j in reversed(range(len(s))):
    if s[j]=='Z':
        b=j
        break
print(b-a+1)
Buggy code:
s=input()
a=0
find_a=0
z=len(s)-1
find_z=0
while find_a==0 or find_z==0:
    if find_a==0 and s[a]=="A":
        find_a=1
    if find_z==0 and s[z]=="Z":
        find_z=1
    if find_a==0:
        a+=1
    if find_z==0:
        z-=1
print(z,a)
print(z-a+1)

Fixed code:
s=input()
a=0
find_a=0
z=len(s)-1
find_z=0
while find_a==0 or find_z==0:
    if find_a==0 and s[a]=="A":
        find_a=1
    if find_z==0 and s[z]=="Z":
        find_z=1
    if find_a==0:
        a+=1
    if find_z==0:
        z-=1
print(z-a+1)
Buggy code:
s = input()
aidx = -1
zidx = -1
for i in range(len(s)):
  if aidx == -1 and s[i] == 'A':
    aidx = i
  if zidx == -1 and s[len(s)-1-i] == 'Z':
    zidx = len(s)-1-i
  if aidx != -1 and zidx != -1:
    break
print(zidx-aidx)

Fixed code:
s = input()
aidx = -1
zidx = -1
for i in range(len(s)):
  if aidx == -1 and s[i] == 'A':
    aidx = i
  if zidx == -1 and s[len(s)-1-i] == 'Z':
    zidx = len(s)-1-i
  if aidx != -1 and zidx != -1:
    break
print(zidx-aidx+1)
Buggy code:
s=input()
for i in range(len(s)):
    if s[i]=='A':
        start=i
        break
for j in range(len(s)):
    if s[-j]=='Z':
        end=len(s)-j
        break
print(end-start+1)

Fixed code:
s=input()
for i in range(len(s)):
    if s[i]=='A':
        start=i
        break
for j in range(1,len(s)):
    if s[-j]=='Z':
        end=len(s)-j
        break
print(end-start+1)
Buggy code:
s=str(input())
a,b=s.find("A"),s,rfind("Z")
print(b-a+1)

Fixed code:
s=str(input())
a,b=s.find("A"),s.rfind("Z")
print(b-a+1)
Buggy code:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
# from fractions import gcd
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from functools import reduce
from bisect import bisect_left, insort_left
from heapq import heapify, heappush, heappop

INPUT = lambda: sys.stdin.readline().rstrip()
INT = lambda: int(INPUT())
MAP = lambda: map(int, INPUT().split())
S_MAP = lambda: map(str, INPUT().split())
LIST = lambda: list(map(int, INPUT().split()))
S_LIST = lambda: list(map(str, INPUT().split()))

sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7


def main():
    S = INPUT()

    for i in range(len(S)):
        if S[i] == 'A': a = i
    for i in range(len(S) - 1, -1 , -1):
        if S[i] == 'Z': z = i

    print(z - a + 1)


if __name__ == '__main__':
    main()


Fixed code:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
# from fractions import gcd
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from functools import reduce
from bisect import bisect_left, insort_left
from heapq import heapify, heappush, heappop

INPUT = lambda: sys.stdin.readline().rstrip()
INT = lambda: int(INPUT())
MAP = lambda: map(int, INPUT().split())
S_MAP = lambda: map(str, INPUT().split())
LIST = lambda: list(map(int, INPUT().split()))
S_LIST = lambda: list(map(str, INPUT().split()))

sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7


def main():
    S = INPUT()

    for i in range(len(S)):
        if S[i] == 'A':
            a = i
            break
    for i in range(len(S) - 1, -1, -1):
        if S[i] == 'Z':
            z = i
            break

    print(z - a + 1)


if __name__ == '__main__':
    main()
Buggy code:
s = input()

aind = 0
for i , c in enumerate(s):
  if c == "A":
    aind =  i
    break
zind = 0
for i,c in enumerate(s):
  if c == "Z":
    zind = i
    
print(zind-aind)

Fixed code:
s = input()
 
aind = 0
for i , c in enumerate(s):
  if c == "A":
    aind =  i
    break
zind = 0
for i,c in enumerate(s):
  if c == "Z":
    zind = i
    
print(zind-aind + 1)
Buggy code:
import re

s = input()

result = re.search(r"A.*Z", s)
print(result.group(0))


Fixed code:
import re

s = input()

result = re.search(r"A.*Z", s)
print(len(result.group(0)))
Buggy code:
s=input()
a=s.index("A")
b=s.rfind("Z")
print(s[a:b+1])

Fixed code:
s=input()
a=s.index("A")
b=s.rfind("Z")
print(len(s[a:b+1]))
Buggy code:
s = input()
l = s.find("A")
r = s.rfind("Z")
print(l - r + 1)


Fixed code:
s = input()
l = s.find("A")
r = s.rfind("Z")
print(r - l + 1)
Buggy code:
s = input()

a = s.find("A")
z = s.find("Z")
print(z-a+1)

Fixed code:
s = input()

a = s.find("A")
z = s.rfind("Z")
print(z-a+1)
Buggy code:
s=list(input())

a=s.index("A")
for i in range(len(s),0):
  if s[i-1]=="Z":
    z=i-1
z-=len(s)-1
sum=z-a+1
print(sum)

Fixed code:
s=list(input())
n=len(s)
a=s.index("A")
for i in range(n,0,-1):
  if s[i-1]=='Z':
    z=i
    break
sum=z-a
print(sum)
Buggy code:
s = input()
start = s.index("A")
fin = s.rindex("Z")
ans = s[start:fin+1]
print(len(ans),ans)


Fixed code:
s = input()
start = s.index("A")
fin = s.rindex("Z")
ans = s[start:fin+1]
print(len(ans))
Buggy code:
s = input()
for i in range(len(s)):
    if s[i] == 'A':
        head = i
        break
for i in range(len(s)):
    if s[-(1+i)] == 'Z':
        tail = len(s)-i-1
        break
print('tail=' + str(tail))
print('head=' + str(head))
print(tail - head + 1)

Fixed code:
s = input()
for i in range(len(s)):
    if s[i] == 'A':
        head = i
        break
for i in range(len(s)):
    if s[-(1+i)] == 'Z':
        tail = len(s)-i-1
        break
print(tail - head + 1)
Buggy code:
s=input()
i=s.find('A')
j=s.rfind('Z')

print(i)
print(j)

print(abs(i-j+1))

Fixed code:
s=input()
i=s.find('A')
j=s.rfind('Z')

print(abs(i-j)+1)
Buggy code:
s = list(input())
a = 0
z = 0
for i in range(len(s)):
    if s[i] == 'A':
        a = i+1
        break
for i in range(1, len(s)):
    if s[-i] == 'Z':
        z = len(s)-i+1
print(z-a+1)

Fixed code:
s = list(input())
a = 0
z = 0
for i in range(len(s)):
    if s[i] == 'A':
        a = i+1
        break
for i in range(1, len(s)):
    if s[-i] == 'Z':
        z = len(s)-i+1
        break
print(z-a+1)
Buggy code:
s=input()
a=s.index("A")
z=0
for i in range(len(s)):
    if s[-i]=="Z":
        print((len(s)-a-i+1))
        break

Fixed code:
s=input()
a=s.index("A")
z=0
for i in range(1,len(s)):
    if s[-i]=="Z":
        print((len(s)-a-i+1))
        break
Buggy code:
s = input()
l = len(s)
for i in range(l):
    if s[i] == 'A':
        a = i
        break
for i in range(l - 1, -1, -1):
    if s[i] == 'Z':
        z = i
        break
print(z - a)

Fixed code:
s = input()
l = len(s)
for i in range(l):
    if s[i] == 'A':
        a = i
        break
for i in range(l - 1, -1, -1):
    if s[i] == 'Z':
        z = i
        break
print(z - a + 1)
Buggy code:
n=int(input())
ans=2*n//11
n-=11*(n//11)
if n==0:
  ans+=0
elif n<=6:
  ans+=1
else:
  ans+=2
print(ans)

Fixed code:
x=int(input())
n=x//11
x=x-11*n
if x==0:
    print(2*n)

elif 1<=x<=6:
    print(1+2*n)
else:
    print(2+2*n)
Buggy code:
a=int(input())
n=2*a//11+a%11//7+min(1,a%11)
print(n)

Fixed code:
a=int(input())
n=2*(a//11)+a%11//7+min(1,a%11)
print(n)
Buggy code:
x = int(input())

cnt = x // 11
cnt += (0 if x % 11 == 0 else 1 if x % 11 <= 6 else 2)

print(cnt)

Fixed code:
x = int(input())

cnt = 2 * (x // 11)
cnt += (0 if x % 11 == 0 else 1 if x % 11 <= 6 else 2)

print(cnt)
Buggy code:
#!/usr/bin/env python

x = int(input())
t = x-11*(x//11)
if t <= 6:
    if x%11 != 0:
        ans = 2*(x//11)+1
    else:
        ans = 2*(x//11)
else:
    if x%11 != 0:
        ans = 2*(x//11)+1
    else:
        ans = 2*(x//11)+2
print(ans)


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

x = int(input())
t = x-11*(x//11)
if t <= 6:
    if x%11 != 0:
        ans = 2*(x//11)+1
    else:
        ans = 2*(x//11)
else:
    if x%11 != 0:
        ans = 2*(x//11)+2
    else:
        ans = 2*(x//11)+1
print(ans)
Buggy code:
# 6, 5, 6, 5, ...

x = int(input())
q = x // 11
r = x % 11
if r == 0:
    ans = q * 2
elif 1 <= r <= 5:
    ans = q * 2 + 1
elif 6 <= ans <= 10:
    ans = q * 2 + 2
print(ans)


Fixed code:
# 6, 5, 6, 5, ...

x = int(input())
q = x // 11
r = x % 11
if r == 0:
    ans = q * 2
elif 1 <= r <= 6:
    ans = q * 2 + 1
elif 7 <= r <= 10:
    ans = q * 2 + 2
print(ans)
Buggy code:
x=int(input())
 
p=x//11
q=x%11
q2=q-6
 
if q==0
  print(2*p)
elif q2<0:
  print(2*p+1)
else:
  print(2*p+2)

Fixed code:
x=int(input())
 
p=x//11
q=x%11
q2=q-6
 
if q==0:
  print(2*p)
elif q2<=0:
  print(2*p+1)
else:
  print(2*p+2)
Buggy code:
import sys, re
from math import ceil, floor, sqrt, pi, factorial, gcd
from copy import deepcopy
from collections import Counter, deque
from heapq import heapify, heappop, heappush
from itertools import accumulate, product, combinations, combinations_with_replacement
from bisect import bisect, bisect_left, bisect_right
from functools import reduce
from decimal import Decimal, getcontext
# input = sys.stdin.readline 
def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_list(N): return [s_list() for _ in range(N)]
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 6)
INF = float('inf')
MOD = 10 ** 9 + 7
num_list = []
str_list = []

def main():
    n = i_input()

    ans = n // 5.5

    if n % 100 <= 6:
        ans += 1
    else:
        ans += 2

    print(ans)
 
if __name__ == '__main__':
    main()


Fixed code:
import sys, re
from math import ceil, floor, sqrt, pi, factorial, gcd
from copy import deepcopy
from collections import Counter, deque
from heapq import heapify, heappop, heappush
from itertools import accumulate, product, combinations, combinations_with_replacement
from bisect import bisect, bisect_left, bisect_right
from functools import reduce
from decimal import Decimal, getcontext
# input = sys.stdin.readline 
def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_list(N): return [s_list() for _ in range(N)]
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 6)
INF = float('inf')
MOD = 10 ** 9 + 7
num_list = []
str_list = []

def main():
    n = i_input()

    n += 4

    print(n//11*2 + (n%11>4))
 
if __name__ == '__main__':
    main()
Buggy code:
from math import *

def cin(): # To take limited number of inputs
    return map(int,input().split())

def cins(): # To take space sepreated strings
    return input.split()

def cino(test=False): # To take individual int input (test = False)
    if not test:
        return int(input())
    else: # To take string input (test = True)
        return input()

def cina(): # array input
  return list(map(int,input().split()))

def ssplit(): # multiple string input
    return list(input().split())

def printlist(l): # To print space seperated array
    for i in l:
        print(i,end=" ")

def main():
   n = int(input())
   print((2*(n//11)) + (n%11>0 and n%11<=6) + (n>6))



if __name__ == '__main__':
    main()

Fixed code:
from math import *

def cin(): # To take limited number of inputs
    return map(int,input().split())

def cins(): # To take space sepreated strings
    return input.split()

def cino(test=False): # To take individual int input (test = False)
    if not test:
        return int(input())
    else: # To take string input (test = True)
        return input()

def cina(): # array input
  return list(map(int,input().split()))

def ssplit(): # multiple string input
    return list(input().split())

def printlist(l): # To print space seperated array
    for i in l:
        print(i,end=" ")

def main():
   n = int(input())
   print((2*(n//11)) + (n%11>0 and n%11<=6) + 2*(n%11>6))



if __name__ == '__main__':
    main()
Buggy code:
a=int(input())
ans=a//11*2
a%=11
if a>=6>=1:ans+=1
elif a!=1:ans+=2
print(ans)

Fixed code:
a=int(input())
ans=a//11*2
a%=11
if 6>=a>=1:ans+=1
elif a!=0:ans+=2
print(ans)
Buggy code:
x = int(input())

s = x//11

if 11*s == x:
  print(s*2)
elif x <= 11*s + 6:
  print(s*2+1)
else:
  print(S*2+2)


Fixed code:
x = int(input())
 
s = x//11
 
if 11*s == x:
  print(s*2)
elif x <= 11*s + 6:
  print(s*2+1)
else:
  print(s*2+2)
Buggy code:
count = 0
x = int(input())
count = int(x/11)
x -= count*11
print(x)
if x == 0:
  print(2*count)
elif x <= 6:
  print(2*count+1)
else:
  print(2*count+2)

Fixed code:
x = int(input())
count = 0

count = x//11*2
if 0 < x-count*11/2 <= 6:
    count += 1
elif 0 < x-count*11/2:
    count += 2
print(count)
Buggy code:
x=int(input())

a=x%11
b=x//11
print(a,b)
if 0<a<6:
    ans=2*b+1
elif a==0:
    ans=2*b
elif 5<a<11:
    ans=2*(b+1)
print(ans)

Fixed code:
x=int(input())
 
a=x%11
b=x//11
 
if a==0:
    ans=2*b
elif a<=6:
    ans=2*b+1
elif 5<a<11:
    ans=2*b+2
print(ans)
Buggy code:
x = int(input())

if x < 6:
    ans = 1
elif x <= 11:
    ans = 2
else:
    ans = (x//7) + x%7 

      
print(ans)

Fixed code:
x=int(input())

ans=2*(x//11)
if 1<=x%11<=6:
  ans+=1
elif 7<=x%11:
  ans+=2

print(ans)
Buggy code:
x = int(input())
c = (x/11)*2
x %= 11
if x==0: print(c)
elif x<6: print(c+1)
else: print(c+2)

Fixed code:
x=int(input())
c=0
c+=x//11*2
rest=x%11
if(0<rest<=6):
    c+=1
elif(6<rest<11):
    c+=2
print(c)
Buggy code:
x=int(input())
mod=x%11
div=int(x/11)
if mod > 6:
    print(div*2+2)
elif: mod == 0:
    print(div*2)
else:
    print(div*2+1)

Fixed code:
x =  int(input())

div = x // 11
mod = x % 11

if mod == 0:
    print(div*2)
elif mod <= 6:
    print(div*2+1)
else:
    print(div*2+2)
Buggy code:
import math
n = int(input())

if n <= 6:
  print(1)
  exit(0)
  
a = math.floor((n / 11)*2)
amari = n % 11
if amari <= 6:
  print(a + 1)
  exit(0)

if amari > 6:
  print(a + 2)
  exit(0)

print(a)


Fixed code:
import math
n = int(input())
  
a = math.floor((n / 11))*2
amari = n % 11
if amari == 0:
  print(a)
  exit(0)
  
if amari <= 6:
  print(a + 1)
  exit(0)

if amari > 6:
  print(a + 2)
  exit(0)

print(a)