Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- alphabet = "abcdefghijklmnopqrstuvwxyz"
- key = 3
- word = input("Plese enter a char:")
- position = alphabet.find(word)
- print("Entered position = " + str(position))
- encryptedPosition = (position + key) % 26
- print("Ecrypted position = " + str(encryptedPosition))
- encryptedWord = alphabet[encryptedPosition]
- print("Encrypted char = " + encryptedWord)
- encryptedWord = ""
- for i in range(len(word)):
- print("Letter - " + word[i] + "index = " +str(i))
- encryptedWord += word[i]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement