擅长:python、mysql、java
<p>你需要做的是:</p>
<pre><code>>>> import pythontest
>>> f = pythontest.Fridge()
</code></pre>
<p>奖励:你的代码最好这样写:</p>
<pre><code>def __init__(self, items=None):
"""Optionally pass in an initial dictionary of items"""
if items is None:
items = {}
if not isinstance(items, dict):
raise TypeError("Fridge requires a dictionary but was given %s" % type(items))
self.items = items
</code></pre>