micropython/tests/basics/frozenset1.py

21 wiersze
266 B
Python
Czysty Zwykły widok Historia

# basic sets
try:
frozenset
except NameError:
print("SKIP")
import sys
sys.exit()
s = frozenset()
print(s)
s = frozenset({1})
print(s)
s = frozenset({3, 4, 3, 1})
print(sorted(s))
2015-08-28 19:31:31 +00:00
# frozensets are hashable unlike sets
print({frozenset("1"): 2})