Last active
November 8, 2021 17:21
-
-
Save martinwithaar/feb6506921b833a122b30d7c4f317b8c to your computer and use it in GitHub Desktop.
LAB: A LED Display
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
My implementation for the Python course lab assignment at https://edube.org/learn/pe-2/lab-a-led-display-3