'How to get UTF-16 numeric value of a characters in python?

My goal is something like this

Input:

"ABC"

Output:

[0x0041, 0x0042, 0x0043]

The outputs are corrosponding UTF-16 value of each character. How do I get the numeric(BIN/HEX/DEC) UTF-16 value from a string or single character?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source