2014-01-10 06:25:03 -05:00
|
|
|
d = dict.fromkeys([1, 2, 3, 4])
|
|
|
|
l = list(d.keys())
|
|
|
|
l.sort()
|
|
|
|
print(l)
|
|
|
|
|
|
|
|
d = dict.fromkeys([1, 2, 3, 4], 42)
|
|
|
|
l = list(d.values())
|
|
|
|
l.sort()
|
|
|
|
print(l)
|
|
|
|
|
2016-11-26 00:38:38 -05:00
|
|
|
# argument to fromkeys has no __len__
|
|
|
|
d = dict.fromkeys(reversed(range(1)))
|
2016-11-25 23:38:48 -05:00
|
|
|
print(d)
|