'How can my Python program retrieve a changing cloud number constantly?

I have a better new question here

I am creating a Python program that needs a new number with 4 decimal places every 2 seconds. The number needs to change on the cloud so it can be retrieved constantly by multiple computers every time the number changes.

Note: I have not made anything yet. I want to know how to make it.

Goal: If I and a friend are on our separate computers running the same local Python program, we should both see the same 5 digit number every 2 seconds.

The code should be something like this, but it should be on the cloud running 24/7. I know how to make a new number every 2 seconds, I just don't know how to make one in the cloud run constantly and be able to be retrieved at any time.

import time
import random

while True:
    number = randint(0,100) #I can change how it gets the number, I just need this to run in the cloud constantly
    time.sleep(2)


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source