Decimal to Binary in Python

Description

Python program to get decimal number and convert it into binary.
Input:
11
Ouput:
1011

Solution

binary_num,base=0,1
decimal_num=int(input("Enter a Decimal number:"))
while (decimal_num > 0):
    remainder = decimal_num % 2
    binary_num = binary_num + remainder * base
    decimal_num = decimal_num // 2
    base = base * 10
print(binary_num)

Explanation

Yet to be updated