The 4 digit digit lottery is an online lottery game played with a random number generator, which randomly generates 4 digits in a row, with…