SyntaxFix
Write A Post
Hire A Developer
Questions
I've tried this in Python 3.6.9
Convert Binary to Decimal
>>> 0b101111 47 >>> int('101111',2) 47
Convert Decimal to binary
>>> bin(47) '0b101111'
Place a 0 as the second parameter python assumes it as decimal.
>>> int('101111',0) 101111