When making a game in Python 3, I would recommend using a module like Pygame, (which I do not believe is compatible with GDB Online yet).
One of the best ways to format the code of a game is by starting with defining functions for things like player movement, gravity, setting up the game, and one for what will happen each tick. Then, code the parts that don't need their own function, because they only happen once. Then, finally, I would make loop that runs the game (also known as a game loop), by repeatedly calling the function(s) that would cause the game to run as intended. I would recommend using a "while true" loop for the game loop.
I hope this helps, have a very wonderful day, -TransCode