第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

求教:類中的參數(shù)問題

求教:類中的參數(shù)問題

22with33 2018-08-20 15:53:47
lass?Recipe: ????def?__init__(self): ????????self.set_default_Recipe() ????????return ????def?set_default_Recipe(self): ????????self.recipes?=?{"cheese?omelet":{"eggs":2,"milk":1,"cheese":1}, ????????????????????????"mushroom?omelet":{"eggs":2,"milk":1,"cheese":1,"mushroom":1}, ????????????????????????"onion?omelet":{"eggs":2,"milk":1,"cheese":1,"onion":1}} ????????return?self.recipes ????def?get(self,name): ????????try: ????????????recipe?=?self.recipe[name] ????????????return?recipe ????????except?KeyError?: ????????????return?False如下運(yùn)行:a?=?Recipe >>>?a.get("banana")然后報(bào)錯(cuò):Traceback?(most?recent?call?last): ??File?"<pyshell#16>",?line?1,?in?<module> ????a.get("banana") TypeError:?get()?missing?1?required?positional?argument:?'name'self 應(yīng)該是實(shí)例,前面的a 不就是嗎,又為什么說我還缺一個(gè)參數(shù)呢求教!
查看完整描述

1 回答

  • 1 回答
  • 0 關(guān)注
  • 824 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)