Convert int to BCD data

I’m sorry but I can’t understand.

I need to write a decimal value. Example. 14.

this number in BCD means 0001 0100. Every decimal digit means four bits.

Example: Decimal 1 = BCD 0001
Decimal 4 = BCD 0100
I need a code to make that convertion. I have no idea how to building this code…Sorry but I’m not a deep python or Java programmer.

Regards,
Leandro