Commit 1b30337
authored
fixed indexing error (OmkarPathak#23)
Enter your message: vishal
Enter you key [1 - 26]: 7
Encrypt or Decrypt? [E/D]: e
---------------------------------------------------------------------------
IndexError Traceback (most recent call last)
<ipython-input-9-9d857a810c45> in <module>
35
36 if __name__ == '__main__':
---> 37 main()
<ipython-input-9-9d857a810c45> in main()
30
31 if choice.lower().startswith('e'):
---> 32 print(encrypt(message, key))
33 else:
34 print(decrypt(message, key))
<ipython-input-9-9d857a810c45> in encrypt(message, key)
9 num = LETTERS.find(chars)
10 num += key
---> 11 encrypted += LETTERS[num]
12
13 return encrypted
IndexError: string index out of range
______________________________________________
Above issue was solved1 parent e0eb3f7 commit 1b30337
1 file changed
+9
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
15 | 18 | | |
16 | 19 | | |
17 | 20 | | |
| |||
21 | 24 | | |
22 | 25 | | |
23 | 26 | | |
24 | | - | |
25 | | - | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
26 | 32 | | |
27 | 33 | | |
28 | 34 | | |
| |||
0 commit comments