For this Question: Given a number N. The task is to generate and print all binary numbers with decimal values from 1 to N.

Try solving this using a queue.The only line of input contains a single integer N.

1 <= N <= 50000Print all binary numbers with decimal values from 1 to N in a single line.Sample Input:
5

Sample Output:
1 10 11 100 101, I have written this Solution Code: def DecimalToBinary(num):
    return "{0:b}".format(int(num))

n = int(input())
for i in range(1,n+1):
    print(DecimalToBinary(i),end=" "), In this Programming Language: Python, Now tell me if this Code is compilable or not?