私のプログラムはユーザーからの入力を求めますが、26 の倍数 (または 0 が入力された場合) を拒否し、ユーザーに再度入力するよう求めます。これを行う方法がわかりません。入力を26で割って整数を取得することと関係があると思います。
現在のコードは次のとおりです。
ValidInput = False
while ValidInput == False:
try:
Key = int(input('Enter the amount that shifts the plaintext alphabet to the ciphertext alphabet: '))
except:
print("Sorry, that isn't an integer. ")
else:
ValidInput = True
return Key