00:01
So for this question, we're asked to generate all the primaries between 1 and n, so in python, right? so what we're going to do is first we're going to have our main function here, right? we'll just call it a function right here and say def, print, right, and we're given value m to print out.
00:22
So we're going to loop through from, we want to go for i in range 0 to...
00:37
I, so we want to go from 0 to i, sorry, we want to go from 0 to n, inclusive, or in this case we do n plus 1 so that we can get all the way to up to n.
00:53
If is prime, n, print, print i.
01:09
So we're going to loop through from every integer from 0 all the way to n.
01:14
If that n is, sorry, not n, if that i is prime, we're going to use a helper function is prime to determine that.
01:24
We're going to print i.
01:25
And then after that, we're going to be done with the function.
01:27
So here, we're going to define a new function called is prime.
01:33
And inside is going to take n as a parameter.
01:37
If n is less than or equal to one, this is obviously not true.
01:43
So it's going to return false.
01:46
Negative numbers cannot be prime, and 0 and 1 are both not prime numbers...