Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def eratosthenes():
- count = 1
- while True:
- count += 1
- mod_of_two = (count % 2 == 0)
- mod_of_three = count % 3 == 0
- mod_of_five = count % 5 == 0
- mod_of_seven = count % 7 == 0
- if (mod_of_two and (count != 2) or (mod_of_three and count != 3) or (mod_of_five and count != 5) or (mod_of_seven and count != 7)):
- pass
- else:
- print(count)
- yield count
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement