-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathex39_extra.py
38 lines (29 loc) · 936 Bytes
/
ex39_extra.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# Extra exercise.
# Date: 2014-16-25
import hashmap
# The tests that it will work.
jazz = hashmap.new()
hashmap.set(jazz, 'Miles Davis', 'Flamenco Sketches')
# confirms set will replace previous one
hashmap.set(jazz, 'Miles Davis', 'Kind Of Blue')
hashmap.set(jazz, 'Duke Ellington', 'Beginning To See The Light')
hashmap.set(jazz, 'Billy Strayhorn', 'Lush Life')
print "---- List Test ----"
hashmap.list(jazz)
print "---- Get Test ----"
print hashmap.get(jazz, 'Miles Davis')
print hashmap.get(jazz, 'Duke Ellington')
print hashmap.get(jazz, 'Billy Strayhorn')
print "---- Delete Test ----"
print "** Goodbye Miles"
hashmap.delete(jazz, "Miles Davis")
hashmap.list(jazz)
print "** Goodbye Duke"
hashmap.delete(jazz, "Duke Ellington")
hashmap.list(jazz)
print "** Goodbye Billy"
hashmap.delete(jazz, "Billy Strayhorn")
hashmap.list(jazz)
print "** Goodbye Pork Pie Hat"
hashmap.delete(jazz, "Charles Mingus")
hashmap.list(jazz)