Пример #1
0
def test_5_times_8_plus_7_times_3_returns_141():
    assert calc("3 5 8 * 7 + *") == 141
Пример #2
0
def test_0_returns_0():
    assert calc("0") == 0
Пример #3
0
def test_12_divided_by_4_returns_3():
    assert calc("12 4 /") == 3
Пример #4
0
def test_12_minus_4_returns_8():
    assert calc("12 4 -") == 8
Пример #5
0
def test_3_times_4_returns_12():
    assert calc("3 4 *") == 12
Пример #6
0
def test_empty_string():
    assert calc("") == 0
Пример #7
0
def test_2_plus_3_plus_4_returns_9():
    assert calc("2 3 + 4 +") == 9
Пример #8
0
def test_2_plus_2_plus_2_returns_6():
    assert calc("2 2 2 + +") == 6
Пример #9
0
def test_2_plus_2_returns_4():
    assert calc("2 2 +") == 4
Пример #10
0
def test_2_returns_2():
    assert calc("2") == 2
Пример #11
0
def is_solution(nums: Numbers, t: int) -> bool:
    try:
        return calc(nums) == t
    except NotValidEqnError:
        return False