Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- trunk_volume = float(input())
- total_volume = trunk_volume
- counter = 0
- added = 0
- while True:
- current_volume = input()
- if current_volume == 'End':
- print(f'Congratulations! All suitcases are loaded!')
- break
- current_bag_volume = float(current_volume)
- counter += 1
- if counter % 3 == 0:
- current_bag_volume = current_bag_volume + (current_bag_volume * 0.1)
- if total_volume - current_bag_volume >= 0:
- total_volume -= current_bag_volume
- added += 1
- else:
- print(f'No more space!')
- break
- print(f'Statistic: {added} suitcases loaded.')
Advertisement
Add Comment
Please, Sign In to add comment