Skip to content

Latest commit

 

History

History
8 lines (5 loc) · 534 Bytes

README.md

File metadata and controls

8 lines (5 loc) · 534 Bytes

Prime

Assigment was to find all prime numbers up to a given user input, using a Sieve of Eratosthenes. the restriction was that it had to be implemented using python.

The first implemention (prime.py) was completed in under 30 minutes. It uses a dictionary to cross out each found composite number. Then uses the keys left over to reveal the prime numbers.

The second implementation (primeoop.py) was my refactoring of the implementation to use OOP styles. I then added new methods to provide a more flexible implementation.