getting pygame keyboard events as integers
<p>I am making a math game and I want the user to be able to enter the answer. Do I have to do something like this for each number.</p>

<pre><code>for event in pygame.event.get():
    blahblahblah
    quit event
    if event.key == K_1:
        str(answer + 1)
</code></pre>

<p>Is there a way to get keyboard events and if they are numbers turn them into integers. Perhaps a build in method?        </p>