DiYane

*Moving*9/9

Aug 10th, 2021
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.49 KB | None | 0 0
  1. width = int(input())
  2. lenght = int(input())
  3. height = int(input())
  4.  
  5. free_space = True
  6. total_free_space  = width * lenght * height
  7. command = input()
  8.  
  9. while command != 'Done':
  10.     box_num = int(command)
  11.     total_free_space -= box_num
  12.     if total_free_space < 0:
  13.         free_space = False
  14.         break
  15.     command = input()
  16.  
  17. if free_space:
  18.     print(f'{total_free_space} Cubic meters left.')
  19. else:
  20.     print(f'No more free space! You need {abs(total_free_space)} Cubic meters more.')
Advertisement
Add Comment
Please, Sign In to add comment