def _init(self,items = {}):
"""Optionally pass in an inital dictionary of items"""
if type(items) != type({}):
raise TypeError("Fridge requires a dictonary but was given
%s " %type(items))
self.items = items
22with33
浏览 1860回答 4
4回答
大咪
def _init(self, items={}):
"""Optionally pass in an inital dictionary of items"""
if type(items) != type({}):
raise TypeError("Fridge requires a dictonary but was given \
% s " %type(items))
self.items = items