Advertisement
BbJLeB

06. Wedding Seats

Jun 6th, 2019
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.60 KB | None | 0 0
  1. # 06. Wedding Seats
  2.  
  3. sector = input()
  4. row = int(input())
  5. seats_odd_row = int(input())
  6.  
  7. count = 0
  8.  
  9. for sectors in range(ord('A'), ord(sector) + 1):
  10.     for rows in range(1, row + 1):
  11.         if rows % 2 == 1:
  12.             for seats_odd_rows in range(1, seats_odd_row + 1):
  13.                 print(f'{chr(sectors)}{rows}{chr(seats_odd_rows + 96)}')
  14.                 count += 1
  15.         elif rows % 2 == 0:
  16.             for seats_odd_rows in range(1, seats_odd_row + 3):
  17.                 print(f'{chr(sectors)}{rows}{chr(seats_odd_rows + 96)}')
  18.                 count += 1
  19.     row += 1
  20. print(f'{count}')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement