Guest User

Untitled

a guest
Nov 23rd, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. def fit(box1, box2):
  2. for a, b in zip(box1, box2): #проверяем попарно
  3. if a > b:
  4. return False
  5. return True
  6.  
  7.  
  8. def boxes(a1, b1, c1, a2, b2, c2):
  9. box1 = [a1, b1, c1]
  10. box2 = [a2, b2, c2]
  11. box1.sort()
  12. box2.sort()
  13. if box1 == box2:
  14. return "Boxes are equal"
  15.  
  16. if fit(box1, box2):
  17. return "The first box is smaller than the second one"
  18.  
  19. if fit(box2, box1):
  20. return "The first box is larger than the second one"
  21.  
  22. return "Boxes are incomparable"
  23.  
  24. #test
  25. print(boxes(1, 2, 3, 3, 1, 2))
  26. print(boxes(2, 2, 3, 3, 2, 1))
  27. print(boxes(2, 2, 3, 3, 2, 3))
  28. print(boxes(3, 4, 5, 2, 4, 6))
Add Comment
Please, Sign In to add comment