Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- count_floors = int(input())
- count_rooms = int(input())
- list_end_floor = []
- list_odd = []
- list_even = []
- list_all = []
- # Последен етаж
- for room in range(0, count_rooms):
- last_floor = f'L{count_floors}{room}'
- list_end_floor.append(last_floor)
- for x in list_end_floor:
- print(x, end=' ')
- print()
- for floor in range(count_floors - 1, 0, -1):
- list_odd.clear()
- list_even.clear()
- if floor % 2: # Нечетни етажи
- for room in range(0, count_rooms):
- odd_floor = f'A{floor}{room}'
- list_odd.append(odd_floor)
- for x in list_odd:
- print(x, end=' ')
- print()
- else:
- for room in range(0, count_rooms):
- even_floor = f'O{floor}{room}'
- list_even.append(even_floor)
- for x in list_even:
- print(x, end=' ')
- print()
Add Comment
Please, Sign In to add comment