I am new to using python so I apologize if I do not use the correct terms. I am writing a simple program to where the user inputs a decimal number and the program converts it to a binary number. So far I have:
remainder=0
decimal_number= int(input('Enter the decimal number:'))
while decimal_number != 0:
(decimal_number, remainder) = divmod(decimal_number,2)
print(remainder)
If I input 11, the output looks like
1
1
0
1
My question is how can I format it to be in one single line, and how can I reverse is so it is written correctly? (ex. from the output shown above to '1011'). I am also aware there is a binary function, but I am not allowed to use it in my program.