I don't understand?? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
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

9th Jun 2019, 5:27 PM
Akash
Akash - avatar
3 Answers
+ 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".
9th Jun 2019, 5:48 PM
Diego
Diego - avatar
+ 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
9th Jun 2019, 5:58 PM
Diego
Diego - avatar
0
So maketrans, translate are special function
9th Jun 2019, 5:50 PM
Akash
Akash - avatar