mirror of
https://github.com/erg-lang/erg.git
synced 2025-09-29 20:34:44 +00:00
9 lines
331 B
Python
9 lines
331 B
Python
assert [1, 2].concat([3, 4]) == [1, 2, 3, 4]
|
|
|
|
assert [1, 2, 3, 1, 2].count(1) == 2
|
|
assert ["a", "b", "c"].count("a") == 1
|
|
|
|
assert [1, 1, 2].dedup() == [1, 2]
|
|
assert [0.0, 0.1, 10.0, 20.0, 20.1].dedup((lhs, rhs) -> abs(lhs - rhs) < 1.0) == [0.1, 10.0, 20.1]
|
|
|
|
assert [-2, -1, 0, 1, 2].partition(x -> x >= 0) == ([0, 1, 2], [-2, -1])
|