ht put("ga""collide"for key in ("good""better""best""worst""ad""ga") ht get(keyprint(vrunning this returns the followingpython hashtable py eggs ham spam none do not collide as you can seelooking up the key worst returns nonesince the key does not exist the keys ad and ga also return their corresponding valuesshowing that the collision between them is dealt with using [with the hash table using the put(and get(methods doesn' look very goodhowever we want to be able to treat our hash table as listthat iswe would like to be able to use ht["good"instead of ht get("good"this is easily done with the special methods __setitem__(and __getitem__()def __setitem__(selfkeyvalue)self put(keyvaluedef __getitem__(selfkey)return self get(keyour test code can now look like this insteadht hashtable(ht["good""eggsht["better""hamht["best""spamht["ad""do notht["ga""collidefor key in ("good""better""best""worst""ad""ga")