擅长:python、mysql、java
<pre><code>def main():
num1 = random.randrange(100,1000)
num2 = random.randrange(100,1000)
print "Please add the following numbers:"
print " ", num1
print "+ ", num2
print " "
correctAnswer = num1 + num2
userAnswer = int(raw_input(" "))
if userAnswer == correctAnswer:
print "Great job!"
else:
# Return the correct answer for the user
print "You're wrong! The correct answer was %s!" % correctAnswer
</code></pre>
<p>试试看?你知道吗</p>