format binary, octal, hexa numbers



examples/format/print_binary.py
a = 42

text = "{:b}".format(a)
print(text)   # 101010

text = "{:#b}".format(a)
print(text)   # 0b101010

examples/format/print_octal.py
a = 42

text = "{:o}".format(a)
print(text)   # 52

text = "{:#o}".format(a)
print(text)   # 0o52

examples/format/print_hexa.py
a = 42

text = "{:x}".format(a)
print(text)   # 2a 

text = "{:#x}".format(a)
print(text)   # 0x2a

text = "{:#X}".format(a)
print(text)   # 0x2A