Repl.it process died unexpectedly
You had just a couple things going wrong with your program:
whileloop has to exit at some point. It was dependent on
countnot being equal to the length of
countwas never modified so the while loop is infinite and breaks Python. A simple fix was adding
count += 1to the next line.
- Once that was fixed, you had an
appendcommand on a string. You only need to
appendyour arrays here. With strings, you would do
last_note += i.
- And then you want the user to see the encoded string, so I put that as a print statement.
I made a fork of your program that you can see here: https://repl.it/@heyitsmarcus/Encryption
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'))
pls solve my problem i am on node.js it is coming process dies
the link is https://replit.com/@ThunderGaming5/packagejson#main.js