This is a more complex example, aren't ready for it. Okay, let's let's do this lottery number generator. So we're going to use a generator function to define to create a function of lottery number. Okay, let's first import the library random number and execute this code. Next is we can define a pin number function that reads a pin number one that I use the for loop in green six, and the yield statement that produces random dot random it. It's a method within the library random and the number that we're looking to producers between one and 52.
The first six number that we need is between one and 50 Seventh generating number is we are looking between one and 25. So let's execute this code and move to next code. We defined a variable then pause this function to a variable. And then we're going to produce. So what it is actually going to do it is going to produce when numbers to execute this line of code now, this line of code it printed nine, so the random number generator between one and 50 is nine. And I'm going to generate the rest of the numbers within this number by you The for loop.
So I defined this and let's produce the results. So all the seven numbers are now generated. If I go back above, you see I use the y variable, it generated nine. Now I'm not using this Y variable again the next time when I use the for loop, so it should be all seven numbers together. 1234567 so it is a treating offer the results that are being called one by one and it produces all the numbers together. If I wanted to generate one number at a time, I could have used next