circuitpython/tests/basics/ifexpr.py
2016-11-26 16:15:31 +11:00

10 lines
118 B
Python

# test if-expressions
print(1 if 0 else 2)
print(3 if 1 else 4)
def f(x):
print('a' if x else 'b')
f([])
f([1])