the-honk/gcse computer science/year 9/encryption/Caesar Cipher Decrypter.py

18 lines
394 B
Python
Raw Normal View History

2021-05-28 20:38:55 +00:00
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