SyntaxFix
Write A Post
Hire A Developer
Questions
You can use int casting which allows the base specification.
int(b, 2) # Convert a binary string to a decimal int.