From b223ec1bae562d8d7a9536a459ef901a9e6c2c1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9F=D1=83=D0=B7=D0=B0=D0=BD=D0=BE=D0=B2=20=D0=9F=D0=B0?= =?UTF-8?q?=D0=B2=D0=BB=D0=BE?= <124675990+CrazyDuck192@users.noreply.github.com> Date: Tue, 21 Mar 2023 20:28:59 +0200 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=BC=D0=B0=D1=88=D0=BD=D1=8F=20?= =?UTF-8?q?=D1=80=D0=BE=D0=B1=D0=BE=D1=82=D0=B0=20=E2=84=9612=20(=E2=84=96?= =?UTF-8?q?16.33)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 16.33.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 16.33.py diff --git a/16.33.py b/16.33.py new file mode 100644 index 0000000..5d4c758 --- /dev/null +++ b/16.33.py @@ -0,0 +1,18 @@ +def primes(m, n): + while m <= n: + is_prime = True + for i in range(2, int(m**0.5)+1): + if m % i == 0: + is_prime = False + break + if is_prime and m > 1: + yield m + m += 1 + else: + m += 1 + + +if __name__ == '__main__': + p = primes(100, 200) + for x in p: + print(x) \ No newline at end of file