Advertisement
Veselina_M

Untitled

Apr 22nd, 2020
619
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.43 KB | None | 0 0
  1. load_capacity=float(input())
  2. command=input()
  3. volume_total=0
  4. suitcase_counter=0
  5.  
  6. while command!="End":
  7.     volume=float(command)
  8.     volume_total+=volume
  9.  
  10.     if volume_total>=load_capacity:
  11.         print("No more space!")
  12.         break
  13.  
  14.     command=input()
  15.     suitcase_counter += 1
  16.  
  17. if command=="End":
  18.     print("Congratulations! All suitcases are loaded!")
  19.  
  20. print(f"Statistic: {suitcase_counter} suitcases loaded.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement