Below is a Python program, that I have written, that converts decimal numbers to binary. However, I'm getting errors. Can anyone help?
def decimaltobin(n):
(ls,count,i)=([],0,0)
while(n>0):
ls[i]=n%2
n=n/2
i=i+1
while(i>0):
print(ls[i])
i=i-1
decimaltobin(8)