Can I use integers to use a unicode in python?

Viewed 35

I have a slight problem that may be unsolvable in python. Can you use an integer variable to type unicode in python? For example, let's say you have a variable: `variable = 0041`. Can you do something like (without having to manually type it) get `\u0041` (`a`)?
I have not really tried anything because nothing comes to mind when I try to solve this problem. If there is a possible solution, what is it?

Sorry if the answer is painfully obvious or I did not provide enough information, I'm new to this.

1 Answers

This is what the chr function is for.

>>> chr(int('0041', 16))
'A'
Related