Answer the question
In order to leave comments, you need to log in
Recoding in Python, how to write concisely?
There is a line: " \xd0\x94\xd0\xb0, \xd0\xbf\xd1\x82\xd0\xb8\xd1\x86\xd1\x8b \xd0\xbe\xd0\xbf\xd0\xb0\xd1\x81\ xd0\xbd\xd1\x8b "
When decrypting through the site: " Yes, birds are dangerous "
I am sincerely convinced that in python it is possible to convert this in one line so that a normal Russian text is written in the terminal, please help with the command. Preferably in one line
Answer the question
In order to leave comments, you need to log in
decode is a built-in function, but it is not for a string, but for the bytes type, so you need to specify b' at the beginning
b'\xd0\x94\xd0\xb0, \xd0\xbf\xd1\x82\xd0\xb8\xd1\x86\xd1\x8b \xd0\xbe\xd0\xbf\xd0\xb0\xd1\x81\xd0\xbd\xd1\x8b "'.decode()
Out[106]: 'Да, птицы опасны "'
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question