擅长:python、mysql、java
<p>只需使用<a href="http://effbot.org/zone/python-getattr.htm" rel="nofollow">^{<cd1>}</a>:</p>
<pre><code>earthquake1 = Earthquake()
answer = input("What data would you like to see?")
print(getattr(earthquake1, answer))
</code></pre>