Is there an opposite of the bin() function? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Is there an opposite of the bin() function?

Is then an opposite of the bin() that turns a binary number into a decimal?

23rd Mar 2019, 12:38 PM
Dan Karnaukh
3 Answers
+ 11
Here it is: int(binaryNumber, 2) First argument is to enter the binary number, like 1001 1111 Second argument is to enter the base, which is 2 in case of binary number. Working example over here: https://code.sololearn.com/cAI27hk6nVtY/?ref=app
23rd Mar 2019, 12:50 PM
Letsintegreat
Letsintegreat - avatar
+ 1
Thank you very much.
24th Mar 2019, 12:50 AM
Dan Karnaukh
0
THANK YOU!!!!!!!!!
30th Dec 2020, 4:58 AM
Mhemanth Bvamsi
Mhemanth Bvamsi - avatar