logo

Crowdly

Browser

Add to Chrome

Here is a program that converts a decimal number to binary. Identify which line ...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

Here is a program that converts a decimal number to binary. Identify which line contains an error:

n = int(input())

ds = []

while n // 2 != 0:

ds.append(n % 2)

n = n / 2

ds.append(n % 2)

for i in range(len(ds) - 1, -1, -1):

print(ds[i], end='')

0%
0%
0%
0%
More questions like this

Want instant access to all verified answers on usth.learningsupport.vn?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome