Advertisement
fkudinov

7. Порівняння двох таблиць / Задачі на Python / Острів Ешера

Aug 12th, 2024
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.73 KB | Source Code | 0 0
  1. # ----------   tasks/escher_tasks/task_7__keys_and_locks.py  -------------
  2.  
  3. def keys_and_locks(lock, some_key):
  4.     return True
  5.  
  6.  
  7. # ----------   tests/test_escher_tasks/test_task_7__keys_and_locks.py  -------------
  8.  
  9. from tasks.escher_tasks.task_7__keys_and_locks import keys_and_locks
  10.  
  11.  
  12. def test_keys_and_locks():
  13.  
  14.     assert keys_and_locks('''
  15. 0##0
  16. 0##0
  17. 00#0
  18. 00##
  19. 00##''',
  20. '''
  21. 00000
  22. 000##
  23. #####
  24. ##000
  25. 00000''') == True
  26.  
  27.     assert keys_and_locks('''
  28. ###0
  29. 00#0''',
  30. '''
  31. 00000
  32. 00000
  33. #0000
  34. ###00
  35. 0#000
  36. 0#000''') == False
  37.  
  38.     assert keys_and_locks('''
  39. 0##0
  40. 0#00
  41. 0000''',
  42. '''
  43. ##000
  44. #0000
  45. 00000
  46. 00000
  47. 00000''') == True
  48.  
  49.     assert keys_and_locks('''
  50. ###0
  51. 0#00
  52. 0000''',
  53. '''
  54. ##00
  55. ##00''') == False
  56.  
  57.  
Tags: checkio
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement