Advertisement
Guest User

Untitled

a guest
Dec 14th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.67 KB | None | 0 0
  1. sector = input()
  2. num_of_row = int(input())
  3. num_of_seats_odd_row = int(input())
  4. num_of_A = ord('A')
  5. num_of_end = ord(sector)
  6. num_of_small_a = ord('a')
  7. counter_row = 1
  8. total_seats = 0
  9. for i in range(num_of_A, num_of_end + 1):
  10.     for i2 in range(1, num_of_row + (i - num_of_A) + 1):
  11.         if i2 % 2 == 0:
  12.             for i3 in range(num_of_small_a, num_of_small_a + num_of_seats_odd_row + 2):
  13.                 print(f'{chr(i)}{i2}{chr(i3)}')
  14.                 total_seats += 1
  15.         else:
  16.             for i3 in range(num_of_small_a, num_of_small_a + num_of_seats_odd_row):
  17.                 print(f'{chr(i)}{i2}{chr(i3)}')
  18.                 total_seats += 1
  19. print(total_seats)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement