Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def is_prime(num):
- if num < 2:
- return False
- for i in range(2, int(num ** 0.5) + 1):
- if num % i == 0:
- return False
- return True
- def prime_generator(limit):
- num = 2
- while num < limit:
- if is_prime(num):
- yield num
- num += 1
- prime_gen = prime_generator(1000)
- print("First 20 prime numbers:")
- for _ in range(20):
- print(next(prime_gen))
Advertisement
Comments
-
- How to play slot machine with good and fair with good agent only at here KINGSAN168. because at here will give you good advice play on which game and which game player have good ratio on winning play. dont hestitate to play at here buddy. #kingsan168 or can visit our website for more infomation https://kingsan168.com/
Add Comment
Please, Sign In to add comment
Advertisement