Skip to content

Instantly share code, notes, and snippets.

@asukaminato0721
Created October 5, 2022 09:08
Show Gist options
  • Save asukaminato0721/e5c9ef0edb39507107cf25142bdbd3e8 to your computer and use it in GitHub Desktop.
Save asukaminato0721/e5c9ef0edb39507107cf25142bdbd3e8 to your computer and use it in GitHub Desktop.
good data structure + simple algorithm.
num2str = {
k: v.split("\n")[1:]
for k, v in {
1: """
|
|""",
2: """
_
_|
|_ """,
3: """
_
_|
_|""",
4: """
|_|
|""",
5: """
_
|_
_|""",
6: """
_
|_
|_|""",
7: """
_
|
|""",
8: """
_
|_|
|_|""",
9: """
_
|_|
_|""",
0: """
_
| |
|_|""",
}.items()
}
s = list(map(int, filter(str.isdigit, input())))
for i in range(3):
for j in s:
print(f"{num2str[j][i]:<4}", end="")
print()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment