Converting between binary and decimal in python

less than 1 minute read

Use the builtin bin() function to convert integers to binary. Use int(binary_repr, 2) to convert back.

Leave a Comment