Advertisement
fkudinov

8. Різні способи аналізу тексту / Задачі на Python / Острів Ешера

Oct 7th, 2024
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.58 KB | Source Code | 0 0
  1. # ----------- tasks/escher_tasks/task_8__safe_code.py ---------------------
  2.  
  3. def safe_code(equation):
  4.     return -1
  5.  
  6.  
  7. # --------------    tests/test_escher_tasks/test_task_8__safe_code.py  -------
  8.  
  9. import pytest
  10. from tasks.escher_tasks.task_8__safe_code import safe_code
  11.  
  12.  
  13. @pytest.mark.parametrize("equation, res", [
  14.     ("-5#*-1=5#", 0),
  15.     ("5#*-1=-5#", 0),
  16.     ("##*##=302#", 5),
  17.     ("19--45=5#", -1),
  18.     ("##--11=11", -1),
  19.     ("#9+3=22", 1),
  20.     ("11*#=##", 2),
  21.     ("#9+3=12", -1),
  22. ])
  23. def test_safe_code(equation, res):
  24.     assert safe_code(equation) == res
  25.  
Tags: checkio
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement