0 votes
1 view
in Python by (12.7k points)

I just want to know, Is there any function or module in python I can use to change a decimal number over to its binary? I can able to change the double over to decimal utilizing int('[binary_value]',2), so any approach to do the opposite without composing the code to do it without anyone else's help?

1 Answer

0 votes
by (26.4k points)

Every numbers are stored in binary. You can use bin(i), if you need a textual representation of a number into binary.

>>> bin(10)

'0b1010'

>>> 0b1010

10

Wanna become a python expert? Come and join the python certification course and get certified.

Related questions

0 votes
1 answer
0 votes
1 answer
asked Oct 15, 2019 in Python by Sammy (47.8k points)
0 votes
1 answer
0 votes
1 answer
asked Oct 15, 2019 in Python by Sammy (47.8k points)
Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...