svephoto

Suitcases Load [Python]

Jul 16th, 2021 (edited)
116
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. airplane_capacity = float(input())
  2. counter = 0
  3. command = input()
  4.  
  5. while command != "End":
  6.     suitcase = float(command)
  7.  
  8.     if (counter + 1) % 3 == 0:
  9.         suitcase *= 1.1
  10.     if suitcase > airplane_capacity:
  11.         print("No more space!")
  12.         print(f'Statistic: {counter} suitcases loaded.')
  13.         break
  14.  
  15.     airplane_capacity -= suitcase
  16.     counter += 1
  17.     command = input()
  18. if command == "End":
  19.     print("Congratulations! All suitcases are loaded!")
  20.     print(f'Statistic: {counter} suitcases loaded.')
  21.  
RAW Paste Data