By default, Google Cloud puts your virtual machine behind a firewall, so it is not accessible from the internet. This is because anything that is accessible on the internet is constantly being probed by hackers. To make your Python web application accessible to anyone, as you need to do for this project, you will need to follow the steps below. Please make sure you don't put any valuable data on the virtual machine.
Google Cloud has the concept of "Networks," with network firewall rules. When a virtual machine is created, it is placed in a project. All the virtual machines in that project have the same firewall rules applied. To make a port accessible, you need to edit the networks settings for the VM instances, as follows.
Once your Compute Engine is set up and ready, click on its name to go to its settings page (see the leftmost arrow in the diagram below)”
Click on the "Network" link (see below); next, click on the "Firewall rules" tab and then on the "Create firewall rule" button to create a new rule with the following settings:
You can now connect to your virtual machine at http://<YOURIP>:8111/