擅长:python、mysql、java
<p>您还删除了属性<code>self.front</code>,然后尝试再次访问它。在</p>
<pre><code>del self.front
print self.front #for testing # you are tying to use self.front but you removed it
</code></pre>
<p>某些函数末尾缺少<code>:</code>。在</p>
^{pr2}$
<p>我不确定您的意图是什么,但是<code>self.front</code>是变量,它没有属性<code>data</code></p>
<pre><code>dequeued = self.front.data # remove the data
</code></pre>
<p>您还缺少<code>def</code>和<code>__init__</code>之间的空格</p>
<pre><code>def__init__(self):
</code></pre>