Comment on Caesar Cipher Python Code by Cryptc.
A more modern way to do this, which is also reasonably easy to read, is with string translations. These are high performance and flexible. You only have to build the mapping once and it will automatically iterate over each character when you translate it.
plainText = input("\nEnter your text: ")
shift = int(input("How many places to shift: "))
lowerAlpha = "abcdefghijklmnopqrstuvwxyz"
upperAlpha = lowerAlpha.upper()
numbers = "0123456789"
before = lowerAlpha + upperAlpha + numbers
after = lowerAlpha[shift:] + lowerAlpha[:shift] + \
upperAlpha[shift:] + upperAlpha[:shift] + \
numbers[shift:] + numbers[:shift]
translation = str.maketrans(before, after)
cipherText = plainText.translate(translation)
print("\nCoded Message: {}".format(cipherText))
print("\nFrom: {}".format(before))
print(" To: {}\n".format(after))
DiddyBorg V2 Robot Kit: The #DiddyBorg is a six-wheel powerhouse of a self-build robot powered...
Junior School Coding Curriculum Key Stage 2: design, write and debug programs that accomplish specific...
How to Include an Arduino Library in a Sketch #Arduino #Coding...
Arduino IDE Manage Libraries #Arduino...
Raspberry Pi Camera Module V2 Attached to a Raspberry Pi 3 Model B+ #RaspberryPi...
Arduino IDE Software Components #Arduino #Software...