Python exception... With this code: class Dictops(): def __init__(self,indict): self.xdict=dict() self.xdict.update(indict) def keyvalsearch(self,key): # write your code
Fantastic news! We've Found the answer you've been seeking!
Question:
Python exception...
With this code:
class Dictops():
def __init__(self,indict):
self.xdict=dict()
self.xdict.update(indict)
def keyvalsearch(self,key):
# write your code here
Resolve on the code above:
Given the class definition Dictops, complete the method named keyvalsearch that, given an input key, will search the object attribute edict for the associated value.
1- A KeyError exception handler should return a value of float('Nan').
2- Otherwise, the function should return the value associated with the input key.
Related Book For
Database Systems Design Implementation and Management
ISBN: 978-1285196145
11th edition
Authors: Carlos Coronel, Steven Morris
Posted Date: