Running Pygame in the browser requires a cross-origin-isolated page with SharedArrayBuffer, which needs a recent version of Chrome, Edge, Firefox or Safari opened directly on Python Classroom — not inside another website's frame.
Open this project in an up-to-date browser on Python Classroom to edit and run it here.