Error Message '_Screen' object has no attribute 'onkeypress'

I am following a tutorial on how to make pong in python and I followed the tutorial exactly but my code doesn’t work. Can somebody look over my code and tell me what is going wrong? The problem is with line 43. Thanks.

How are you running this code?

With key command cmd + i.

Since Atom has no ability to run code by itself, you have to be using a package. I can’t give you any advice unless you identify the package.