Advertisement
ALEXANDAR_GEORGIEV

wedding_seats

Jun 10th, 2022
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.36 KB | None | 0 0
  1. last_sector = input()
  2. list_alphabet_up = []
  3. list_alphabet_lo_odd = []
  4. list_alphabet_lo_even = []
  5. count_rows_first_sector = int(input())
  6. count_seats_odd_row = int(input())
  7. end_lett_odd_row_seats = 97 + count_seats_odd_row
  8.  
  9.  
  10. n = ord(last_sector)
  11. # print(n)
  12. res = ""
  13. for indx in range(65, 91):   # 65 - 90 Cap, Буква = chr(idx), ASCII = ord(char)
  14.     if indx <= n:
  15.         list_alphabet_up.append(chr(indx))
  16. for indx in range(97, 123):   # 97 - 122 lower, Буква = chr(idx), ASCII = ord(char)
  17.     if indx < end_lett_odd_row_seats:
  18.         list_alphabet_lo_odd.append(chr(indx))
  19. for indx in range(97, 123):   # 97 - 122 lower, Буква = chr(idx), ASCII = ord(char)
  20.     if indx < end_lett_odd_row_seats + 2:   # Места на четните редове
  21.         list_alphabet_lo_even.append(chr(indx))
  22. add_row = 0
  23. all_seats = 0
  24. # print(list_alphabet_up)
  25. # print(list_alphabet_lo)
  26. for sect in list_alphabet_up:
  27.     for row in range(1 , count_rows_first_sector + add_row + 1):
  28.         if row % 2:
  29.             for seat in list_alphabet_lo_odd:
  30.                 print(sect + str(row) + seat)
  31.                 all_seats += 1
  32.         elif not row % 2:
  33.             for seat in list_alphabet_lo_even:
  34.                 print(sect + str(row) + seat)
  35.                 all_seats += 1
  36.     add_row += 1
  37. print(all_seats)
  38.  
  39. # print(f'{сектор}{ред}{място}')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement