我正在创建一个从函数返回的字符串。我需要字符串来列出一些值。
我创建了一个列表,该列表在末尾加入以构成完整的字符串。我试图在列表附加到的while循环中的每次迭代上添加一个新行。
while shiftAmount < 25: #Iterates through all 26 combinations producing a processed value each time.
shiftAndStore(shiftAmount)
shiftAmount = shiftAmount + 1
stringshift = str(shiftAmount)
outputCipherText.append("The Encoded / Decoded text on shift " + str((shiftAmount - 1)) + " is ")
outputCipherText.append(str(''.join(completePlainText)) + " \n")
completePlainText = []
output = [''.join(outputCipherText)]
谁能告诉我为什么这不起作用?查看输出它显示了 \n 但不执行它并换行。