On Thu, May 23, 2013 at 9:30 PM,  <lokeshkopp...@gmail.com> wrote:
> i need to get 32 bit binary equivalent of a decimal and need to change the 
> 0's to 1's and 1's to 0's
> For Example
> if the input is 2
> Output should be:
> the 32bit equivalent of 2 :0000 0000 0000 0000 0000 0000 0000 0010
> and the 1's compliment is:1111 1111 1111 1111 1111 1111 1111 1101
>
>
>
> is there any pre-defined function to get the above results in python??

You're asking for bitwise negation. Now that you know the keyword(s)
to look for, you should be able to figure out the rest with a few
quick docs and/or web searches.

ChrisA
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to