Advertisement
GeorgiLukanov87

Suitcases Load

Apr 8th, 2022
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.55 KB | None | 0 0
  1. capacity_luggage = float(input())
  2. input_line = input()
  3. counter = 0
  4. is_full = False
  5. while input_line != "End":
  6.  
  7.     counter += 1
  8.     volume = float(input_line)
  9.  
  10.     if counter % 3 == 0:
  11.         volume = volume * 1.1
  12.  
  13.     if volume > capacity_luggage:
  14.         is_full = True
  15.         counter -= 1
  16.         break
  17.     else:
  18.         capacity_luggage -= volume
  19.  
  20.     input_line = input()
  21.  
  22. if is_full:
  23.     print(f"No more space!")
  24. else:
  25.     print(f"Congratulations! All suitcases are loaded!")
  26. print(f"Statistic: {counter} suitcases loaded.")
  27.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement