I have a block at position (0,0). Periodically (say every 1 second) the y-coordinate of the block will randomly get updated by +/-1.
And every time the user also inputs a character (+/-) the x-coordinate will be updated by +/-1 as the user has inputted.
If it was only the x coord, I could create a while loop, that runs into the next iteration when input() gets a value.
But how can I deal with both the periodic update as well as the real time input (which can come at any time?)