Problem p02664 (python)

Fixed submission:
T = list(str(input()))

for i in range(len(T)):
    if T[i] == '?':
        T[i] = 'D'
    print(T[i],end='')

Buggy submission (verdict: Runtime Error):
T = list(str(input()))

for i in range(len(T)):
    if T[i] == '?'
        T[i] = 'D'
    elif T[i] == '?' and T[i + 1] == 'D':
        T[i] = 'P'
    elif T[i] == '?' and T[i + 1] == '?':
        T[i] = 'P'
        T[i + 1] = 'D'
        i += 1
    elif T[i] == '?':
        T[i] = 'D'
    print(T[i],end='')

Buggy submission (verdict: Runtime Error):
T = list(str(input()))

for i in range(len(T)):
    if T[i] == '?'
        T[i] = 'D'

print(''.join(T))

Buggy submission (verdict: Runtime Error):
T = list(str(input()))

for i in range(len(T)):
    if T[i] == '?'

print(''.join(T))

Buggy submission (verdict: Runtime Error):
T = list(str(input()))

for i in range(len(T)-1):
    if T[i] == '?' and T[i - 1] == 'P':
        T[i] = 'D'
    elif T[i] == '?' and T[i + 1] == 'D':
        T[i] = 'P'
    elif T[i] == '?' and T[i + 1] == '?':
        T[i] = 'P'
        T[i + 1] = 'D'
        i += 1
    elif T[i] == '?':
        T[i] = 'D'

if i == len(T):
    if T[i] == '?' and T[i - 1] == 'P':
        T[i] = 'D'
    elif T[i] == '?':
        T[i] = 'D'

print(''.join(T))

Buggy submission (verdict: Runtime Error):
T = list(str(input()))

for i in range(len(T)):
    if T[i] == '?' and T[i - 1] == 'P':
        T[i] = 'D'
    elif T[i] == '?' and T[i + 1] == 'D':
        T[i] = 'P'
    elif T[i] == '?' and T[i + 1] == '?':
        T[i] = 'P'
        T[i + 1] = 'D'
        i += 1
    elif T[i] == '?':
        T[i] = 'D'        

TL=''.join(T)
print(TL)

Buggy submission (verdict: Runtime Error):
T = list((input()))

for i in range(len(T)):
    if T[i] == '?':
        if T[i - 1] == 'P':
            T[i] = 'D'
        elif T[i + 1] == '?':
            T[i] = 'P'
            T[i + 1] = 'D'
            i += 1
        else:
            T[i] = 'D'
        

TL=''.join(T)
print(TL)

Buggy submission (verdict: Runtime Error):
T = list(str(input()))

for i in range(len(T)):
    if T[i] == '?':
        if T[i - 1] == 'P':
            T[i] = 'D'
        elif T[i + 1] == '?':
            T[i] = 'P'
            T[i + 1] = 'D'
            i += 1
        else:
            T[i] = 'D'
        

TL=''.join(T)
print(TL)

Buggy submission (verdict: Runtime Error):
T = list(str(input()))

for i in range(len(T)):
    if T[i] == '?':
        if T[i - 1] == 'P':
            T[i] = 'D'
        elif T[i + 1] == '?':
            T[i] = 'P'
            T[i + 1] = 'D'
            i= i+1
        else:
            T[i] = 'D'
        

TL=''.join(T)
print(TL)

Buggy submission (verdict: Runtime Error):
T = list(str(input()))

for i in range(len(T)):
    if T[i] == '?':
        if T[i - 1] == 'P':
            T[i] = 'D'
        elif T[i + 1] == "?":
            T[i] = 'P'
            T[i + 1] = 'D'
            i= i+1
        else:
            T[i] = 'D'
        

TL=''.join(T)
print(TL)

Buggy submission (verdict: Runtime Error):
T = list(str(input()))

for i in range(len(T)):
    if T[i] == '?':
        if T[i - 1] == 'P':
            T[i] = 'D'
        elif T[i + 1] == "?":
            T[i] = 'P'
            T[i + 1] = 'D'
            i= i+1
        else:
            T[i] = 'P'
        

TL=''.join(T)
print(TL)