fork download
  1. hexToBinArray = {'0': '0000', '1': '0001', '2': '0010', '3': '0011',
  2. '4': '0100', '5': '0101', '6': '0110', '7': '0111',
  3. '8': '1000', '9': '1001', 'A': '1010', 'B': '1011',
  4. 'C': '1100', 'D': '1101', 'E': '1110', 'F': '1111'}
  5.  
  6. htba = hexToBinArray
  7.  
  8. def bitmap(string):
  9. hexList = string.split(" ")
  10. i = 0
  11.  
  12. while i < len(hexList):
  13. hexList[i] = list(hexList[i])
  14. i += 1
  15.  
  16. i = 0
  17.  
  18. while i < len(hexList):
  19. p1 = htba[hexList[i][0]]
  20. p2 = htba[hexList[i][1]]
  21. fi = p1+p2
  22. hexList[i] = fi
  23. i += 1
  24.  
  25. i = 0
  26.  
  27. while i < len(hexList):
  28. temp = ''
  29. for value in hexList[i]:
  30. if value == '0':
  31. temp = temp + ' '
  32. else:
  33. temp = temp + 'x'
  34. hexList[i] = temp
  35. i += 1
  36.  
  37. for x in hexList:
  38. print(x)
Success #stdin #stdout 0.03s 9440KB
stdin
Standard input is empty
stdout
Standard output is empty