tests/basics: Add tests for if-expressions.

This commit is contained in:
Damien George 2016-11-26 16:15:31 +11:00
parent a31a3a9fd5
commit a4f96c8c2a
1 changed files with 9 additions and 0 deletions

9
tests/basics/ifexpr.py Normal file
View File

@ -0,0 +1,9 @@
# 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])