r/pythonhelp • u/Slayer3041 • Sep 13 '22
Can't use Bin method, but need to accomplish what it does
For a Lab I need to convert an int into its binary representation, however I am not allowed to use the bin method. Whenever I load a string with this data it automatically converts to displaying my added 0b then the original int value. Any suggestions?
0
Upvotes
2
u/carcigenicate Sep 14 '22
Have you looked up how to convert a number to binary? What have you tried to accomplish this already?
And what do you mean by "Whenever I load a string with this data it automatically converts to displaying my added 0b then the original int value."?