我想这就是你想要的。
print("")
encryptString = input("Please enter string to encrypt:")
print("")
offSetValue = int(input("Please enter offset value (1-94):"))
print("")
print("Encrypted string:")
for character in encryptString:
x = ord(character)
y = x + offSetValue
z = chr(y)
print(z, end="")
print()
你想要
print("Encrypted string:")
在循环和使用之前
end
而不是
sep
.
九月
用于分隔打印中的多个参数。
终止
是在打印内容的末尾添加的终止字符。这里我们以空字符串结束。默认的
终止
是新线人物,
\n
.这就是为什么你看到所有的东西都印在新的一行上。