What is 1100111111 here? A number written in decimal where you want to interpret digits as binary digits? Why don't you use 0b1100111111 to have a litteral written in binary representation?
Le dim. 16 févr. 2020 à 16:32, <ananthakrishnan15.2...@gmail.com> a écrit : > > I'll show the example using one's and two's complement. > >>binary.ones_complement(1100111111) > 0011000000 > >>binary.twos_complement(1100111111) > 0011000001 > _______________________________________________ > Python-ideas mailing list -- python-ideas@python.org > To unsubscribe send an email to python-ideas-le...@python.org > https://mail.python.org/mailman3/lists/python-ideas.python.org/ > Message archived at > https://mail.python.org/archives/list/python-ideas@python.org/message/RJLGYE4N7NR6JYFSA64VES375U45PIKW/ > Code of Conduct: http://python.org/psf/codeofconduct/ -- Antoine Rozo _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/JTVV74CXKBOZJ4REKXWQWU4WGEXSNDGJ/ Code of Conduct: http://python.org/psf/codeofconduct/