Is there a python version for JavaScript String.fromCharCode?

String.fromCharCode returns a string based on a list of Unicode code values. @see reference

Is there an analogue in Python?

+6
source share
2 answers

You can use this: ''.join(map(unichr, lst))

Example:

 ''.join(map(unichr, [65,66,67])) # outputs ABC 
+14
source

You can use chr () or unichr () for unicode values.

+5
source

Source: https://habr.com/ru/post/890993/


All Articles