您好,我有点难以理解为什么字符串索引被列为“超出范围”。考虑我试图在这段代码中翻译的字符串:
a = str("g fmnc wms bgblr rpylqjyrc gr zw fylb. rfyrq ufyr amknsrcpq ypc dmp. bmgle gr gl zw fylb gq glcddgagclr ylb rfyr'q ufw rfgq rcvr gq qm jmle. sqgle qrpgle.kyicrpylq() gq pcamkkclbcb. lmu ynnjw ml rfc spj.")
b = 0
while True:
if a[b] == str("k"):
a.replace("k", "m")
b = b + 1 #Methodically checks each string for a 'k' and replaces it with a 'm'
elif a[b] == str("o"):
a.replace("o", "q")
b = b + 1#Checks for an 'o' and replaces with 'q'
elif a[b] == str("e"):
a.replace("e", "g")
b = b + 1
else:
b = b + 1
continue
if b == 202:
print(a)
break