micropython/tests/basics/set_intersection.py
Andrew Scheller 1ff6011abc Modify set tests to print sorted sets directly
instead of creating temporary lists and sorting those in-place
2014-04-07 05:00:03 +01:00

8 lines
162 B
Python

s = {1, 2, 3, 4}
print(sorted(s))
print(sorted(s.intersection({1, 3})))
print(sorted(s.intersection([3, 4])))
print(s.intersection_update([1]))
print(sorted(s))