Using Python to convert integer to binary
binary, integer, python
Solution
Are you aware of the builtin `bin` function?
>>> bin(100)
'0b1100100'
>>> bin(1)
'0b1'
>>> bin(0)
'0b0'
Problem
I'm trying to convert integer to binary. This is my work. I don't know how the make a list to show the binary. ``` num_str = input("Please give me a integer: ") num_int = int(num_str) while num_int > 0: if num_int % 2 == 0: num_int = int(num_int / 2) num_remainder = 1 print("The remainder is:", 0) continue elif num_int % 2 == 1: num_int = int(num_int / 2) num_remainder = 1 print("The remainder is:", 1) continue ``` How to make the remainder together?