R
R
Rezo20062020-04-24 20:39:01
Python
Rezo2006, 2020-04-24 20:39:01

I can't figure out what's wrong? I decided to write a script to decrypt my cipher, but it swears at the PassMes5 variable. Knowledgeable people can help?

Python 3.7
My Code:

import re
passWord = input("Введите пароль: ")
if passWord == "5948603782":
    message = input()
    passMes = sub("24", "р", message)
    passMes1 = sub("0", " ", passMes)
    passMes2 = sub("01", "а", passMes1)
    passMes3 = sub("02", "б", passMes2)
    passMes4 = sub("38", "в", passMes3
    passMes5 = sub("09", "г", passMes4)
    passMes6 = sub("56", "д", passMes5)
    passMes7 = sub("78", "е", passMes6)
    passMes8 = sub("45", "ё", passMes7)
    passMes9 = sub("89", "ж", passMes8)
    passMes10 = sub("39", "з", passMes9)
    passMes11 = sub("47", "и", passMes10)
    passMes12 = sub("24", "й", passMes11)
    passMes13 = sub("45", "к", passMes12)
    passMes14 = sub("86", "л", passMes13)
    passMes15 = sub("28", "м", passMes14)
    passMes16 = sub("29", "н", passMes15)
    passMes17 = sub("03", "о", passMes16)
    passMes18 = sub("36", "п", passMes17)
    passMes19 = sub("05", "с", passMes18)
    passMes20 = sub("21", "т", passMes19)
    passMes21 = sub("49", "у", passMes20)
    passMes22 = sub("20", "ф", passMes21)
    passMes23 = sub("30", "х", passMes22)
    passMes24 = sub("40", "ц", passMes23)
    passMes25 = sub("80", "ч", passMes24)
    passMes26= sub("34", "ш", passMes25)
    passMes27 = sub("97", "щ", passMes26)
    passMes28 = sub("14", "ъ", passMes27)
    passMes29 = sub("65", "ы", passMes28)
    passMes30 = sub("69", "ь", passMes29)
    passMes31 = sub("10", "э", passMes30)
    passMes32 = sub("11", "ю", passMes31)
    passMes33 = sub("78", "я", passMes32)
    print(passMes33)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Karbivnichy, 2020-04-24
@Rezo2006

Line: is missing a parenthesis at the end. Then there will be another error: Replace in the code: with:
passMes4 = sub("38", "в", passMes3
NameError: name 'sub' is not defined
import re
from re import sub

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question