擅长:python、mysql、java
<p><code>weight</code>在第1行变成<code>string type</code>,然后在<code>if statement</code>中比较<code>weight</code>和<code>int</code>。通过将用户输入转换为int来修复此问题</p>
<p>将第一行更改为:</p>
<pre><code>weight = int(raw_input("What are the weight of you parcel: "))
</code></pre>
<p>另外,如果您使用python3,我会将<code>raw_input</code>更改为<code>input</code></p>