Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # 5. Office Chairs List advanced - exercise 100/100
- n = int(input())
- free_seats = 0
- need_more_seats = False
- for num_room in range(1, n+1):
- room = input().split(' ')
- seats = len(room[0])
- people = int(room[1])
- if seats > people:
- free_seats += seats - people
- if seats - people < 0:
- print(f"{abs(seats-people)} more chairs needed in room {num_room}")
- need_more_seats = True
- if not need_more_seats:
- print(f"Game On, {free_seats} free chairs left")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement