I know that there is a function
bin(x) But it makes from the number - binary code. Is there any way to translate or do I need to write a separate code for this ???
I know that there is a function
bin(x) But it makes from the number - binary code. Is there any way to translate or do I need to write a separate code for this ???
If by binary code you mean a string, then the built-in int() function has an optional base argument, which indicates the reason for writing the number in the string:
>>> bin(123) '0b1111011' >>> int('1111011', 2) 123 Source: https://ru.stackoverflow.com/questions/593386/
All Articles
bin()isint(bits,2). Second:int.from_bytes(b"\x73\x6f", 'big')==29551- jfs