tests/basics: Add further tests for OrderedDict.
This commit is contained in:
parent
9275c18270
commit
3d91c12d33
@ -9,8 +9,19 @@ except ImportError:
|
||||
sys.exit()
|
||||
|
||||
d = OrderedDict([(10, 20), ("b", 100), (1, 2)])
|
||||
print(len(d))
|
||||
print(list(d.keys()))
|
||||
print(list(d.values()))
|
||||
del d["b"]
|
||||
print(len(d))
|
||||
print(list(d.keys()))
|
||||
print(list(d.values()))
|
||||
|
||||
# access remaining elements after deleting
|
||||
print(d[10], d[1])
|
||||
|
||||
# add an element after deleting
|
||||
d["abc"] = 123
|
||||
print(len(d))
|
||||
print(list(d.keys()))
|
||||
print(list(d.values()))
|
||||
|
Loading…
x
Reference in New Issue
Block a user