Guest User

Untitled

a guest
Jun 11th, 2020
472
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. capacity = float(input())
  2. command = input()
  3. counter = 0
  4. is_space = True
  5. while command != "End":
  6. number = float(command)
  7. if capacity <= number:
  8. is_space = False
  9. break
  10. capacity -= number
  11. counter += 1
  12. if counter % 3 == 0:
  13. capacity -= number * 0.10
  14. if capacity < 0:
  15. is_space = False
  16. counter -= 1
  17. break
  18.  
  19. command = input()
  20.  
  21. if not is_space:
  22. print("No more space!")
  23.  
  24. if is_space:
  25. print("Congratulations! All suitcases are loaded!")
  26.  
  27. print(f"Statistic: {counter} suitcases loaded.")
Advertisement
Add Comment
Please, Sign In to add comment