Advertisement
fkudinov

1. Розбиття колекції на 2 групи / Вирішуємо задачі на Python / Острів Ешера

Mar 4th, 2024
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.62 KB | Source Code | 0 0
  1. #   ---------   tasks/escher_tasks/task_1__ship_team.py   -------------
  2.  
  3. def two_teams(sailors):
  4.     return []
  5.  
  6.  
  7.  
  8.  
  9. # ----------   tests/test_escher_tasks/test_task1__ship_team.py   ---------
  10.  
  11. from tasks.escher_tasks.task_1__ship_team import two_teams
  12.  
  13.  
  14. def test_two_teams():
  15.  
  16.     assert two_teams({
  17.         'Smith': 34,
  18.         'Wesson': 22,
  19.         'Coleman': 45,
  20.         'Abrahams': 19}) == [
  21.                ['Abrahams', 'Coleman'],
  22.                ['Smith', 'Wesson']
  23.            ]
  24.  
  25.     assert two_teams({
  26.         'Fernandes': 18,
  27.         'Johnson': 22,
  28.         'Kale': 41,
  29.         'McCortney': 54}) == [
  30.                ['Fernandes', 'Kale', 'McCortney'],
  31.                ['Johnson']
  32.            ]
  33.  
  34.     assert two_teams({'Samuelson': 19.99, 'Besson': 28, 'Rick': 39.95, 'Wayfarer': 40.1}) == [
  35.         ['Samuelson', 'Wayfarer'],
  36.         ['Besson', 'Rick']
  37.     ]
  38.  
  39.     assert two_teams({'Pitty': 19, 'Wolf': 40.005, 'Doberman': 42, 'Bobber': 18}) == [
  40.         ['Bobber', 'Doberman', 'Pitty', 'Wolf'],
  41.         []
  42.     ]
  43.  
  44.     assert two_teams({'Carlos': 34, 'Richardson': 20, 'Dow': 40}) == [
  45.         [],
  46.         ['Carlos', 'Dow', 'Richardson']
  47.     ]
  48.  
  49.     assert two_teams({'Dave': 24}) == [
  50.         [],
  51.         ['Dave']
  52.     ]
  53.  
  54.     assert two_teams({'Hubert': 38.3, 'Barney': 31, 'Kirk': 42.5, 'Lion': 56}) == [
  55.         ['Kirk', 'Lion'],
  56.         ['Barney', 'Hubert']
  57.     ]
  58.  
  59.     assert two_teams({'Sam': 19}) == [
  60.         ['Sam'],
  61.         []
  62.     ]
  63.  
  64.     assert two_teams( {'Karl': 17, 'Richard': 20, 'Dantes': 39, 'Fargo': 19}) == [
  65.         ['Fargo', 'Karl'],
  66.         ['Dantes', 'Richard']
  67.     ]
  68.  
Tags: checkio
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement