Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- capacity = float(input())
- total_luggage = 0
- counter_luggage = 0
- luggage_float = 0
- while True:
- luggage_volume = input()
- if luggage_volume == "End":
- break
- else:
- luggage_float = float(luggage_volume)
- total_luggage += luggage_float
- counter_luggage += 1
- if counter_luggage % 3 == 0:
- total_luggage += 0.10 * luggage_float
- if total_luggage > capacity:
- counter_luggage -= 1
- break
- if total_luggage <= capacity:
- print(f"Congratulations! All suitcases are loaded!")
- else:
- print("No more space!")
- print(f"Statistic: {counter_luggage} suitcases loaded.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement