1

To represent a negative number in binary form we can use 0 or 1 as an additional digit in binary number but python return negative sign for negative number using bin function. Why it is not returning negative binary number using 0 and 1, and how can we get binary form of negative number without neagtive sign using Python:

>>> bin(11)
'0b1011'
>>> bin(-11)
'-0b1011'
2

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.