Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def fill_water_tank(capacity, n, amounts):
- current_liters = 0
- for amount in amounts:
- if current_liters + amount > capacity:
- print("Insufficient capacity!")
- else:
- current_liters += amount
- print(current_liters)
- capacity = 255
- n = int(input())
- amounts = [int(input()) for _ in range(n)]
- fill_water_tank(capacity, n, amounts)
Advertisement
Add Comment
Please, Sign In to add comment