Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- trunk_capacity = float(input())
- free_trunk_space = trunk_capacity
- suitcase_volume = input()
- suitcase_number = 0
- added = 0
- while suitcase_volume != 'End':
- volume = float(suitcase_volume)
- suitcase_number += 1
- if suitcase_number % 3 == 0:
- volume += volume * 0.10
- if free_trunk_space < volume:
- print('No more space!')
- break
- else:
- added += 1
- free_trunk_space -= volume
- suitcase_volume = input()
- if suitcase_volume == 'End':
- print("Congratulations! All suitcases are loaded!")
- print(f'Statistic: {added} suitcases loaded.')
Add Comment
Please, Sign In to add comment