Advertisement
fkudinov

9. Задача Пакування Рюкзака / Задачі на Python / Острів Ешера

Nov 14th, 2024 (edited)
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.86 KB | Source Code | 0 0
  1. # --------------     tasks/escher_tasks/task_9__treasures.py   ----------------
  2.  
  3.  
  4. def treasures(info, limit):
  5.     return []
  6.  
  7.  
  8.  
  9. # ----------------  tests/test_escher_tasks/test_task_9__treasures.py ------------------
  10.  
  11.  
  12. from tasks.escher_tasks.task_9__treasures import treasures
  13.  
  14.  
  15. def test_treasures():
  16.  
  17.     assert treasures(
  18.         {'golden coin': {'price': 100, 'weight': 50, 'amount': 200},
  19.          'silver coin': {'price': 10, 'weight': 20, 'amount': 1000},
  20.          'ruby': {'price': 1000, 'weight': 200, 'amount': 2}}, 5
  21.     ) == ['golden coin: 92', 'ruby: 2']
  22.  
  23.     assert treasures(
  24.         {'golden coin': {'price': 100, 'weight': 50, 'amount': 100},
  25.          'silver coin': {'price': 10, 'weight': 20, 'amount': 100},
  26.          'ruby': {'price': 1000, 'weight': 200, 'amount': 1}}, 7.5
  27.     ) == ['golden coin: 100', 'silver coin: 100', 'ruby: 1']
  28.  
Tags: checkio
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement