Skip to content

Instantly share code, notes, and snippets.

@MinaGabriel
Created March 9, 2020 16:51
Show Gist options
  • Save MinaGabriel/a543d884ceee446fab9c7cd9a016dd40 to your computer and use it in GitHub Desktop.
Save MinaGabriel/a543d884ceee446fab9c7cd9a016dd40 to your computer and use it in GitHub Desktop.
def binary_data(n):
b = []
for i in range(1 << n):
s = bin(i)[2:]
s = '0' * (n - len(s)) + s
b.append(map(int, list(s)))
return b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment