Skip to content

Instantly share code, notes, and snippets.

@martinwithaar
Last active November 8, 2021 17:21
Show Gist options
  • Save martinwithaar/feb6506921b833a122b30d7c4f317b8c to your computer and use it in GitHub Desktop.
Save martinwithaar/feb6506921b833a122b30d7c4f317b8c to your computer and use it in GitHub Desktop.
LAB: A LED Display
A = '###'
L = '# '
R = ' #'
D = '# #'
digits = (
(A, D, D, D, A),
(R, R, R, R, R),
(A, R, A, L, A),
(A, R, A, R, A),
(D, D, A, R, R),
(A, L, A, R, A),
(A, L, A, D, A),
(A, R, R, R, R),
(A, D, A, D, A),
(A, D, A, R, A)
)
def do(inp):
for i in range(5):
for c in inp:
n = int(c)
print(digits[n][i], end='')
print(' ', end='')
print()
do('9081726354')
@martinwithaar
Copy link
Author

My implementation for the Python course lab assignment at https://edube.org/learn/pe-2/lab-a-led-display-3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment