Advertisement
Void-voiD

Untitled

Apr 16th, 2023
561
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.36 KB | Source Code | 0 0
  1. x, y = input().split('')
  2. y = 7 - (int(y) - 1)
  3. x = ord(x - 97)
  4.  
  5. # x - столбец, y - строкой
  6.  
  7. for i in range(8):
  8.     for j in range(8):
  9.         if i == y and j == x:
  10.             print('Q', end=' ')
  11.         elif i == y or j == x or i == j:  # y > x
  12.             print('*', end=' ')
  13.         else:
  14.             print('.', end=' ')
  15.     print()
  16.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement