i'm new to python and tried to do something like that:
a=23
"{0:b}".format(a)
---> '10111'
then i want to negate it WITHOUT ones complement, the result should be '01000' but nothing seems to work
secondly i would have to fill up the left side with 0's, i found something like
"{0:12b}".format(a)
' 10111'
but it just makes the string longer filling it up with blanks
EDIT: the perfect solution for me would be
"{0:12b}".format(a)
'000000010110'
"{0:12b}".format(~a)
'111111101001'
(which of course doesnt work this way)