mirror of
https://github.com/licsber/micropython.git
synced 2024-09-21 09:30:24 +08:00
17 lines
190 B
Python
17 lines
190 B
Python
|
# dict constructor
|
||
|
|
||
|
d = dict()
|
||
|
print(d)
|
||
|
|
||
|
d = dict({1:2})
|
||
|
print(d)
|
||
|
|
||
|
d = dict(a=1)
|
||
|
print(d)
|
||
|
|
||
|
d = dict({1:2}, a=3)
|
||
|
print(d[1], d['a'])
|
||
|
|
||
|
d = dict([(1, 2)], a=3, b=4)
|
||
|
print(d[1], d['a'], d['b'])
|