Files
RustPython/tests/snippets/tuple.py
2019-02-03 13:59:43 +13:00

13 lines
229 B
Python

assert (1,2) == (1,2)
x = (1,2)
assert x[0] == 1
y = (1,)
assert y[0] == 1
assert x * 3 == (1, 2, 1, 2, 1, 2)
# assert 3 * x == (1, 2, 1, 2, 1, 2)
assert x * 0 == ()
assert x * -1 == () # integers less than zero treated as 0