Advertisement
fkudinov

2. Перебір Рядків та Колонок Таблиці / Задачі на Python / Острів Ешера

Mar 28th, 2024
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.63 KB | Source Code | 0 0
  1. # --------   tasks/escher_tasks/task_2__ground_of_house.py -----------
  2.  
  3. def house(plan):
  4.     return 0
  5.  
  6.  
  7. # -----------    tests/test_escher_tasks/test_task_2__ground_of_house.py     -----------
  8.  
  9.  
  10. from tasks.escher_tasks.task_2__ground_of_house import house
  11.  
  12.  
  13. def test_house():
  14.  
  15.     assert house('''
  16. 0000000
  17. ##00##0
  18. ######0
  19. ##00##0
  20. #0000#0
  21. ''') == 24     # up 1, down 4, left 0, right 5
  22.  
  23.     assert house('''0000000000
  24. #000##000#
  25. ##########
  26. ##000000##
  27. 0000000000
  28. ''') == 30
  29.  
  30.     assert house('''0000
  31. 0000
  32. #000
  33. ''') == 1
  34.  
  35.     assert house('''0000
  36. 0000
  37. ''') == 0
  38.  
  39.     assert house('''
  40. 0##0
  41. 0000
  42. #00#
  43. ''') == 12
  44.  
Tags: checkio
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement