Posted on 26th April 2024
In Python, we can simply convert integers into binary just by using a bin() function here is the example:
A = 250
B = bin(A)[2:]
Where B is the binary value of A
The reason why I mentioned [2:] is when I convert A to binary the output will be '0b11111010' as the first two value '0b' ate not necessary so to cut those two values we use [2:] which prints from the third value now the final output will be 11111010
STILL GOT QUERIES?