Advertisement
Guest User

06. Wedding Seats

a guest
Jul 30th, 2020
1,656
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.71 KB | None | 1 0
  1. end_sector = input()
  2. row_first_sector = int(input())
  3. seats_odd_row = int(input())
  4.  
  5. counter = 0
  6. start_sector = 65
  7. start_seat = 97
  8.  
  9.  
  10. for sector in range(start_sector, ord(end_sector) + 1):
  11.     for row in range(1, row_first_sector + 1):
  12.         if row % 2 != 0:
  13.             for seats in range(start_seat, (start_seat + seats_odd_row)):
  14.                 print(f'{chr(sector)}{row}{chr(seats)}')
  15.                 counter += 1
  16.         elif row % 2 == 0:
  17.             for seats in range(start_seat, (start_seat + seats_odd_row + 2)):
  18.                 print(f'{chr(sector)}{row}{chr(seats)}')
  19.                 counter += 1
  20.     if row_first_sector + 1 > row_first_sector:
  21.         row_first_sector += 1
  22.  
  23. print(counter)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement