Convert Binary to Int in Python

Conversion

We can convert binary to int by specifying 2 the second argument of int method in Python.

int("1101", 2)
# 13

int("11111111", 2)
# 255