repl.it
@heyitsmarcus/

Encryption

Python

No description

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#not my code, help file for Repl Talk->Ask

print('Welcome to the encryptor.')
menu = input('Would you like to encode or decode a note? ')
letters = [
    "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o",
    "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", ' ']
cyphertext = [
  'K','D','G','F','N','S','L','V','B','W','A','H','E','X','J','M','Q','C','P','Z','R','T','Y','I','U','O', '!', 
  ]
def encode(note):
  new_note = []
  encoded_note = []
  last_note = ''
  count = 0
  while count != len(note):
    new_note.append(note[count].lower())
    count += 1
  print('Encoding note...')
  for i in new_note:
    for letter in letters:
      if i == letter:
        encoded_note.append(cyphertext[letters.index(letter)])
  for i in encoded_note:
    last_note += i
  print(last_note)

print(encode('This is a practice note'))