Where is the mistake? I do not understand.

def b(strng): sym=' ,.-?!";:)(' num='0123456789Z' strong=strng for i in range(11): strong=strong.replace(sym(i),num(i)) answer=sum(seq1[strong[i]]*62**i for i in range(len(strong)))*2 answer=''.join(seq2[answer//(62**i)%62] for i in range(int((log(answer)/log(62)))+1)) return answer 

Here is the error itself:

 Traceback (most recent call last): File "/home/maxwell/pseudo.py", line 62, in <module> print(b('Cipher')) File "/home/maxwell/pseudo.py", line 49, in b strong=strong.replace(sym(i),num(i)) TypeError: 'str' object is not callable 

    1 answer 1

    If parentheses are used after the object name, Python interprets this as a function call:

     sym(i) 

    and

     num(i) 

    are strings - hence the error: 'str' object is not callable

    Use square brackets to index rows:

     strong = strong.replace(sym[i], num[i]) 
    • one
      Oh shit. How could I not notice. Thanks, I'll fix it now - Daniel Sereda
    • four
      In addition to the answer, I will add: in your error output, this is what is written - 'str' object is not callable . Translated as Объект 'str' (string) не может быть вызван . Understanding what is written in the error - the lion's share of understanding of programming in the future. Learn to understand these logs. If you look, everything is very clear. Almost the developer's nose is poked into the place where there is an error. - Don2Quixote