From a comma-separated list of binary numbers, find how many numbers are divisible by a given number x. x is an integer in the range 1 to 9 and the total count of the binary numbers in the list will be less than 1000. You're allowed to create new functions.

Respuesta :

In python:

lst = ([your binary numbers go here])

x = your integer goes here

lst1 = ([])

for i in lst:

   lst1.append(int(i, 2))

print(lst1)

total = 0

for w in lst1:

   if w % x == 0:

       total += 1

print(f"There are a total of {total} number(s) divisible by {x}")

I hope this helps!

RELAXING NOICE
Relax