2014-09-29 14:40:20 -04:00
|
|
|
# test comparison operators
|
|
|
|
@micropython.viper
|
2021-03-15 09:57:36 -04:00
|
|
|
def f(x: int, y: int):
|
2014-09-29 14:40:20 -04:00
|
|
|
if x < y:
|
|
|
|
print(x, "<", y)
|
|
|
|
if x > y:
|
|
|
|
print(x, ">", y)
|
|
|
|
if x == y:
|
|
|
|
print(x, "==", y)
|
|
|
|
if x <= y:
|
|
|
|
print(x, "<=", y)
|
|
|
|
if x >= y:
|
|
|
|
print(x, ">=", y)
|
|
|
|
if x != y:
|
|
|
|
print(x, "!=", y)
|
|
|
|
|
2021-03-15 09:57:36 -04:00
|
|
|
|
2014-09-29 14:40:20 -04:00
|
|
|
f(1, 1)
|
|
|
|
f(2, 1)
|
|
|
|
f(1, 2)
|
|
|
|
f(2, -1)
|
|
|
|
f(-2, 1)
|