The bin() function converts an integer , both positive and negative, into binary form.
Syntax
bin(n)
n – integer being converted
Example
w = 25
x = -10
y = bin(w)[2:] #remove prefix 0b
print(bin(w))
print(bin(x))
print(y)
Output
0b11001
-0b1010
11001