ALEXANDAR_GEORGIEV

building

May 31st, 2022 (edited)
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.87 KB | None | 0 0
  1. count_floors = int(input())
  2. count_rooms = int(input())
  3. list_end_floor = []
  4. list_odd = []
  5. list_even = []
  6. list_all = []
  7. # Последен етаж
  8. for room in range(0, count_rooms):
  9.     last_floor = f'L{count_floors}{room}'
  10.     list_end_floor.append(last_floor)
  11. for x in list_end_floor:
  12.     print(x, end=' ')
  13. print()
  14. for floor in range(count_floors - 1, 0, -1):
  15.     list_odd.clear()
  16.     list_even.clear()
  17.     if floor % 2:  # Нечетни етажи
  18.         for room in range(0, count_rooms):
  19.             odd_floor = f'A{floor}{room}'
  20.             list_odd.append(odd_floor)
  21.         for x in list_odd:
  22.             print(x, end=' ')
  23.         print()
  24.     else:
  25.         for room in range(0, count_rooms):
  26.             even_floor = f'O{floor}{room}'
  27.             list_even.append(even_floor)
  28.         for x in list_even:
  29.             print(x, end=' ')
  30.         print()
Add Comment
Please, Sign In to add comment