A lottery is a way of raising money for something, usually by selling tickets to…