Files
corso-python/lab29.py
T

23 lines
699 B
Python
Raw Normal View History

2026-04-09 09:32:01 +02:00
number = input("Inserisci un numero: ")
digits = [
["###", "# #", "# #", "# #", "###"], # 0
[" #", " #", " #", " #", " #"], # 1
["###", " #", "###", "# ", "###"], # 2
["###", " #", "###", " #", "###"], # 3
["# #", "# #", "###", " #", " #"], # 4
["###", "# ", "###", " #", "###"], # 5
["###", "# ", "###", "# #", "###"], # 6
["###", " #", " #", " #", " #"], # 7
["###", "# #", "###", "# #", "###"], # 8
["###", "# #", "###", " #", "###"], # 9
]
for row in range(5):
line = ""
for ch in number:
digit_index = int(ch)
segment = digits[digit_index][row]
line = line + segment + " "
print(line)