I'm creating a variation of the vigenere cipher using all the ASCII characters using a dictionary. The first few lines are okay, but then I get an error for the value 3.
vigenereDictionary = { "@": "0", "%": "1", "+": "2", "\": "3", "/": "4", ...
I want to have it so that when a user types \ it will output/take the value 3, however, I understand backslash is a special character, is there any way to implement this.
Asked
Active
Viewed 54 times
1

Kai
- 57
- 5
-
5It's an escape character for a string, try using `"\\"`, which escapes the backslash itself. – ChrisOram Jul 18 '22 at 13:43
-
Thank you! I am relatively new to programming and feel a little out of depth so despite being a relatively simple question, couldn't figure it out. (how do I set your comment as the answer?) – Kai Jul 18 '22 at 13:45
1 Answers
0
" It's an escape character for a string, try using "\", which escapes the backslash itself. – ChrisOram "

Kai
- 57
- 5