gluk47

table coding.py

Jun 25th, 2021
1,250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.59 KB | None | 0 0
  1. #!/usr/bin/env python3
  2.  
  3. coding = (
  4.     'QWERT'
  5.     'UIOPS'
  6.     'ASDFL'
  7.     'ZXCVB'
  8.     'TYUES'
  9. )
  10.  
  11. inp = '02 34 20 23 00 00 00'
  12.  
  13. ret = []
  14. try:
  15.     while True:
  16.         for line in input().split('\n'):
  17.             buf = []
  18.             for pair in line.split():
  19.                 row, col = map(int, list(pair))
  20.                 if row == 0 and col == 0 and buf and buf[-1] == 'Q':
  21.                     buf[-1] = 'U'
  22.                     continue
  23.  
  24.                 buf.append(coding[row * 5 + col])
  25.             ret.append(''.join(buf))
  26. except EOFError:
  27.     ...
  28.  
  29. print(' '.join(ret))
Advertisement
Add Comment
Please, Sign In to add comment