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))
Connect Your Raspberry Pi to the Network #RaspberryPi...
Google Coding for Boys: A simple Google image search for 'Coding for Boys' shows lots...
Google Blockly Games Maze 7 Solution #Blockly #Javascript #Coding...
How to Include an Arduino Library in a Sketch #Arduino #Coding...
Primary School Coding Curriculum Key Stage 1: understand what algorithms are, how they are implemented...
Visual Programming Language Blocks: Scratch, Blockly, MIT App Inventor 2 #MIT #Coding #Scratch #Blockly...