class Unsorted_Map(collections.MutableMapping):
def __init__(self , k , v):
return self._key==other._key
return not (self == other)
def __It__(self , other):
return self._key < other._key
def __getitem__(self, k):
raise keyError("key not found")
def __setitem__(self, key, v):
self._table.append(self._Item(k,v))
def __delitem__(self, k):
for i in range(len(self._table)):
if self._table[i]._key == k:
raise keyError("key not found")
from Unsorted_Map import Unsorted_Map
if __name__== '__main__':
um.__setitem__("class", "algorithm")
um.__setitem__("building", "CTUT")
um.__setitem__(7."saturday")
um.__setitem__("a_list",[1,2,3,4])
print(str(key) +" : "+str(um.__getitem__(key)))
um.__setitem__("class","algorithm and data structures")
um.__setitem__("another_list", [6,7,8,9,"a","10"])
print(str(key)+" : "+str(um.__getitem__(key)))
print(um["class"]>um["building"])