[lang-ref] ( ternary_conditional_operator ) ( python )
@pytest.mark.parametrize(
'v, expected',
[
(1, '1'),
(2, '2'),
(3, '3!!!!!!!'),
],
)
def test_ternary_conditional_operator(v, expected):
# x = a if c else b
# In many language: x = c ? a : b
actual = f'{v}!!!!!!!' if v % 3 == 0 else str(v)
assert actual == expected