the-honk/gcse computer science/year 9/python/encryption/caesar cipher encrypter.py
2021-05-28 21:38:55 +01:00

12 lines
No EOL
244 B
Python

output = ''
asc = 0
msg = input('Please input the text.')
key = input('How many characters would you like to shift that text by?')
for i in msg:
asc = ord(i)
shiftChr = asc + int(key)
output = output + chr(shiftChr)
print(output)