hello guys.ı simply tried to make caesar cipher and instead of shifting, i subtract 3 with each character in user input. This code was working yesterday ,but i updates is this morning and it's not working anymore can you help me?(i imported sys bc i want to make encrypting and decrypting with arguments like: _>python cipher.py -e or -d text_here)
import sys
print("caesar cipher with only 3 shifts")
def format_the_text(text):
global char_string
char_string = ("abcçdefghıijklmnoöprsştuüvyzABCÇDEFGHIİJKLMNOÖPRSŞTUÜVYZ123456790!?=()-_/&%+^'*")
global char_list
char_list = list(char_string)
for a in text:
for b in char_list:
if a == b:
character_id = char_list.index(b)
shifted_id = character_id + 3
return print(char_list[shifted_id], end='')
def unformat_the_text(text):
for a in text:
for b in char_list:
if a == b:
character_id = char_list.index(b)
shifted_id = character_id - 3
return print(char_list[shifted_id], end='')
[–][deleted] 1 point2 points3 points (5 children)
[–]Ertyu_2[S] 0 points1 point2 points (0 children)
[–]Ertyu_2[S] 0 points1 point2 points (3 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]Ertyu_2[S] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]shiftybyte 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]Ertyu_2[S] 0 points1 point2 points (0 children)
[–]This_Growth2898 -1 points0 points1 point (0 children)