When I try to convert Decimal To Binary, The code executes with no error but the result is 'none'. Sometimes it just doesn't show anything. I feel there is some logical error can anyone help me correct what's wrong??
Code :
def bin_no():
global rem
n = int(input("Enter Number : ")) #Taking a Decimal Num
while n >=1 : #Initiating a Loop to Convert Decimal To Binary using the (Divide By 2 Method).
rem = []
n = n//2
rem.append(n%2)
if n !>=1: #Going back to the loop if input is invalid.
print("Please enter a Valid Number")
bin_no()
print("Binary Number : ", rem.reverse()) #Printing the result (the binary no. was stored in reverse order.)
bin_no()