circuitpython/tests/micropython/viper_binop_multi_comp.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

23 lines
391 B
Python
Raw Permalink Normal View History

# test multi comparison operators
@micropython.viper
2021-03-15 09:57:36 -04:00
def f(x: int, y: int):
if 0 < x < y:
print(x, "<", y)
if 3 > x > y:
print(x, ">", y)
if 1 == x == y:
print(x, "==", y)
if -2 == x <= y:
print(x, "<=", y)
if 2 == x >= y:
print(x, ">=", y)
if 2 == x != y:
print(x, "!=", y)
2021-03-15 09:57:36 -04:00
f(1, 1)
f(2, 1)
f(1, 2)
f(2, -1)
f(-2, 1)