Problem: We have a string S consisting of lowercase English letters.  If the length of S is at most K, print S without change.  If the length of S exceeds K, extract the first K characters in S, append `...` to the end of them, and print the result.

Submission attempts (in order):
K=int(input())
S=list(input())

SL=len(S)

if SL =< K:
    print(S)
elif SL > K:
    print(S[0:(SL-1):1])

K=int(input())
S=list(input())

if (len(S)+1) <= K:
    print(S)
else:
    print(S[0:K:1],"...")


K=int(input())
S=input()
s=list(S)

if len(s) < K:
    print(S)
else:
    print(s[0:(K-1):1],"...")


K=int(input())
S=list(input())

if len(S) < K:
    print(S)
elif len(S) > K:
    print(S[0:(SL-1):1],"...")


K=int(input())
S=list(input())

LS=len(S)

if LS <= K:
    print(S)
elif LS > K:
    print(S[0:(SL-1):1],"...")


K=int(input())
S=list(input())

if len(S) <= K:
    print(list(S))
else:
    print(S[0:(K-1):1],"...")

K=int(input())
S=input()

SL=len(S)

if SL =< K:
    print(S)
elif SL > K:
    print(S[0:(SL-1):1],"...")


K=int(input())
S=list(input())

if (len(S)+1) <= K:
    print(S)
else:
    print(S[0:(SL-1):1],"...")


K=int(input())
S=input()
s=list(S)

if len(s) =< K:
    print(S)
else:
    print(S[0:K:]+"...")


K=int(input())
S=list(input())

if (len(S)+1) <= K:
    print(S)
elif (len(S)+1) > K:
    print(S[0:(SL-1):1],"...")


K=int(input())
S=list(input())

if len(S) <= K:
    print(S)
else:
    print(S[0:(K-1):1],"...")


K=int(input())
S=list(input())

if len(S) < K:
    print(S)
else:
    print(S[0:(SL-1):1],"...")


K=int(input())
S=list(input())

SL==len(S)

if SL =< K:
    print(S)
elif SL > K:
    print(S[0:(SL-1):1],"...")

K=int(input())
S=input()
s=list(S)

if len(s) < K:
    print(S)
else:
    print(s[0:(K-1):],"...")


K=int(input())
S=input()
s=list(S)

if len(s) < K:
    print(S)
else:
    print(S[0:(K-1):],"...")


K=int(input())
S=list(input())

LS=len(S)

if (LS+1) <= K:
    print(S)
elif (LS+1) > K:
    print(S[0:(SL-1):1],"...")


K=int(input())
S=list(input())

if len(S) < K:
    print(S)
else:
    print(S[0:(K-1):1],"...")

K=int(input())
S=input()
s=list(S)

if len(s) < K:
    print(S)
else:
    print(s[0:K:1],"...")


K=int(input())
S=list(input())

LS==len(S)

if LS <= K:
    print(S)
elif LS > K:
    print(S[0:(SL-1):1],"...")

K=int(input())
S=list(input())

if len(S) =< K:
    print(S)
elif len(S) > K:
    print(S[0:(SL-1):1],"...")


K=int(input())
S=list(input())

LS=len(S)+1

if LS <= K:
    print(S)
elif LS > K:
    print(S[0:(SL-1):1],"...")


K=int(input())
S=list(input())

LS==len(S)+1

if LS <= K:
    print(S)
elif LS > K:
    print(S[0:(SL-1):1],"...")

K=int(input())
S=input()
s=list(S)

if len(s) < K:
    print(S)
else:
    print(s[0:(K-1):],"...")


K=int(input())
S=input()
s=list(S)

if len(s) < K:
    print(S)
else:
    print(s[0:(K-1):]+"...")


K=int(input())
S=input()
s=list(S)

if len(s) <= K:
    print(S)
else:
    print(S[0:K:]+"...")


Verdicts: Runtime Error

Wrong Answer

Wrong Answer

Runtime Error

Runtime Error

Wrong Answer

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Wrong Answer

Runtime Error

Runtime Error

Wrong Answer

Wrong Answer

Runtime Error

Wrong Answer

Wrong Answer

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Wrong Answer

Runtime Error

Accepted