Skip to content

Commit a4f96c8

Browse files
committed
tests/basics: Add tests for if-expressions.
1 parent a31a3a9 commit a4f96c8

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

tests/basics/ifexpr.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# test if-expressions
2+
3+
print(1 if 0 else 2)
4+
print(3 if 1 else 4)
5+
6+
def f(x):
7+
print('a' if x else 'b')
8+
f([])
9+
f([1])

0 commit comments

Comments
 (0)