Guest User

numbers

a guest
Jun 24th, 2020
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.13 KB | None | 0 0
  1. def graphic_number(s):
  2.     if (s.isdigit() == False):
  3.         return None
  4.     d = [
  5.         ('0', '█▀▀█', '█  █', '█  █', '█▄▄█'),
  6.         ('1', '▀▀█ ', '  █ ', '  █ ', '▄▄█▄'),
  7.         ('2', '▀▀▀█', '▄▄▄█', '█   ', '█▄▄▄'),
  8.         ('3', '▀▀▀█', '▄▄▄█', '   █', '▄▄▄█'),
  9.         ('4', '█ █ ', '█▄█▄', '  █ ', '  █ '),
  10.         ('5', '█▀▀▀', '█▄▄▄', '   █', '▄▄▄█'),
  11.         ('6', '█▀▀▀', '█▄▄▄', '█  █', '█▄▄█'),
  12.         ('7', '▀▀▀█', '   █', '   █', '   █'),
  13.         ('8', '█▀▀█', '█▄▄█', '█  █', '█▄▄█'),
  14.         ('9', '█▀▀█', '█▄▄█', '   █', '▄▄▄█'),
  15.     ]
  16.  
  17.     # creating d2
  18.     d2 = []
  19.     for i in s:
  20.         d2.append(d[int(i)])
  21.  
  22.     # printing d2
  23.     x = 1
  24.     for i in range(4):
  25.         for j in range(len(s)):
  26.             print(d2[j][x], end=' ')
  27.         print()
  28.         x += 1
  29.     return 1
  30.  
  31. s = input('Enter a number: ')
  32.  
  33. x = graphic_number(s)
  34. if x == None:
  35.     print('Wrong Input')
Advertisement
Add Comment
Please, Sign In to add comment