Advertisement
HristoBaychev

Building

Feb 5th, 2023 (edited)
645
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.73 KB | None | 0 0
  1. max_floors = int(input())
  2. max_rooms = int(input())
  3.  
  4.  
  5. for floor in range(max_floors, 0, -1):
  6.     for room in range(0, max_rooms):
  7.         if floor == max_floors:
  8.             floor_string = 'L'
  9.             print(f'{floor_string}{floor}{room} ', end='')
  10.             if room == max_rooms-1:
  11.                 print(' ')
  12.  
  13.         if floor % 2 == 0 and floor != max_floors:
  14.             floor_string = 'O'
  15.             print(f'{floor_string}{floor}{room} ', end='')
  16.             if room == max_rooms-1:
  17.                 print(' ')
  18.  
  19.         if floor % 2 != 0 and floor != max_floors:
  20.             floor_string = 'A'
  21.             print(f"{floor_string}{floor}{room} ", end='')
  22.             if room == max_rooms-1:
  23.                 print(' ')
  24.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement