bin(number)
number :input number in decimal num=5
print(bin(num)) # 0b101
num=47
print(bin(num)) # 0b101111
In our binary output, 0b
is always prefixed. As the output is a string we can remove it like this
num=47
num1=bin(num)
print(num1[2:]) # 101111
Without using bin() and by using format()
num=47
print(format(num,'b')) # 101111
All Built in Functions in Python