I want to convert 2 as 10 . but bin() function gives like 0b10. How can I do it?
Asked
Active
Viewed 223 times
-2
Yasiru Lakshan
- 1
- 2
-
3`bin(2)[2:]` should work? – CDJB Jan 23 '20 at 11:54
-
3you must remove that prefix with `bin(2)[2:]` – Ashkan Laei Jan 23 '20 at 11:56
-
2Does this answer your question? [Python int to binary string?](https://stackoverflow.com/questions/699866/python-int-to-binary-string) – cheesysam Jan 23 '20 at 12:57