Question: Please Help me solve this python problem. Thanks! Implement the class myDict with the methods below, which will represent a dictionary without using a dictionary
Please Help me solve this python problem. Thanks!

Implement the class myDict with the methods below, which will represent a dictionary without using a dictionary object. The methods you implement below should have the same behavior as a dict object, including raising appropriate exceptions. Your code does not have to be efficient. Any code that uses a Python dictionary object will receive For example With a dict:With a myDict: md = myDict() # initialize a new object using your choice of implementation d[1] = 2 print(dl1]) del (di11) assign (1,2) print (md.getval (1)) # use getval method to get value stored for key 1 md.delete (1) md. # use assign method to add a key, value pair # use delete method to remove key,value pair associated with key 1 class myDict (object): ""Implements a dictionary without using a dictionary " def init _(self): " " " initialization of your representation """ #FILL THIS IN def assign (self, k, v): """ k (the key) and v (the value), immutable objects #FILL THIS IN def getval self, k): """ k, immutable object #FILL THIS IN def delete(self, k) """ k, immutable object """ #FILL THIS IN
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
