Advertisement
bl00dt3ars

05. Suitcases Load (Dobrin Dobrev)

Nov 11th, 2020
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.57 KB | None | 0 0
  1. capasity = float(input())
  2. command = input()
  3. total_suitcases = 0
  4. loaded_suitcases = 0
  5. enougth = True
  6.  
  7. while command != 'End':
  8.     command = float(command)
  9.     total_suitcases += 1
  10.     if total_suitcases % 3 == 0:
  11.         capasity -= command + (command * 0.1)
  12.     else:
  13.         capasity -= command
  14.     if capasity < 0:
  15.         print(f'No more space!')
  16.         enougth = False
  17.         break
  18.     loaded_suitcases += 1
  19.     command = input()
  20. if enougth:
  21.     print(f'Congratulations! All suitcases are loaded!')
  22. print(f'Statistic: {loaded_suitcases} suitcases loaded.')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement