Advertisement
Guest User

parking_lot

a guest
Jan 27th, 2020
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.32 KB | None | 0 0
  1. parking_lot = set()
  2. while True:
  3.     command = input().split(', ')
  4.     if command[0] == 'END':
  5.         break
  6.    
  7.     direction, car_number = command
  8.     if direction == 'IN':
  9.         parking_lot.add(car_number)
  10.     else:
  11.         parking_lot.remove(car_number)
  12.        
  13. if parking_lot:
  14.     [print(car) for car in parking_lot]
  15. else:
  16.     print('Parking Lot is Empty')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement