kopia lustrzana https://github.com/micropython/micropython
tests/basics: Add tests for if-expressions.
rodzic
a31a3a9fd5
commit
a4f96c8c2a
|
@ -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])
|
Ładowanie…
Reference in New Issue