擅长:python、mysql、java
<h2>问题</h2>
<p>您的代码有三个问题:</p>
<ul>
<li>Python使用缩进来创建块。你知道吗</li>
<li>您已经将输入赋给变量<code>age</code>,所以使用<code>age</code>。你知道吗</li>
<li>在python3中,必须使用<code>print(...)</code>而不是<code>print ...</code></li>
</ul>
<h2>正确的解决方案</h2>
<pre><code>age = raw_input("How old are you? ")
if int(age) < 14:
print("oh yuck")
else:
print("Good, you comprehend things, lets proceed")
</code></pre>
<p>请注意,这并不等同于您的代码。您的代码跳过大小写<code>age == 14</code>。如果你想要这种行为,我建议:</p>
<pre><code>age = int(raw_input("How old are you? "))
if age < 14:
print("oh yuck")
elif age > 14:
print("Good, you comprehend things, lets proceed")
</code></pre>
<h2>学习Python</h2>
<ul>
<li><a href="http://www.codecademy.com/tracks/python" rel="nofollow">http://www.codecademy.com/tracks/python</a>-一个逐步介绍编程/Python的教程</li>
<li><a href="https://docs.python.org/2/library/functions.html" rel="nofollow">Manual</a>-查找事物并发现新事物,例如<a href="https://docs.python.org/2/library/functions.html#raw_input" rel="nofollow">^{<cd6>}</a>和<a href="https://docs.python.org/2/library/functions.html#int" rel="nofollow">^{<cd7>}</a></li>
</ul>