求教:第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


22with33
浏览 1799回答 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

至北

第4行和第5行放在同一行试下
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Python