0
I don't understand??
I came across this piece of code and don't understand from the 11th line of the code(i.e the C part) https://code.sololearn.com/cJRXLur5094o/?ref=app
3 ответов
+ 5
In simple terms, "C.translate(decode)" replaces the characters from "C" that appear in "coded_char" for the corresponding characters in "keys".
For example, '%' gets changed to 'm', '#x27; to 'n', '!' to 'a', '@' to 'e', and so on.
That’s why "%^ $!%@ () _=)@(quot; gets changed to "my name is Hosein".
+ 1
They're called string methods. Not sure what makes a function "special" but I suppose they are.
https://docs.python.org/3/library/stdtypes.html#string-methods
0
So maketrans, translate are special function