the-honk/school/gcse/year 9/encryption/Caesar Cipher Decrypter.py
2021-12-21 19:46:28 +00:00

18 lines
No EOL
394 B
Python

counter = 26
ciphertext = input('Please input some ciphertext to decrypt.')
ciphertext = ciphertext.upper()
while counter >= 0:
outputWord = ''
for i in ciphertext:
asc = ord(i)
shiftChr = asc + counter
if shiftChr >= 90:
shiftChr = (shiftChr-90)+64
outputWord = outputWord + chr(shiftChr)
print(outputWord)
counter = counter - 1