We can convert binary to int by specifying 2 the second argument of int method in Python.
2
int
int("1101", 2) # 13 int("11111111", 2) # 255