def eratosthenes(n):
    """
    this fxn is the Sieve of Eratosthenes. 
    this algorithm generates a list of positive integers up to a given input n,
    then removes all multiples of 2, then 3,then 4, and so on until only the numbers
    that are divisible by 1 and itself are left in the list. and therefore the list only
    consists of all the primes less than or equal to n
    Args:
        n (int): positive integer parameter. where n>1
    Returns:
        prime_list (list): a list of all prime numbers less than or equal to n
    """
    assert n>1                                       #asserting n be a positive integer
    prime_list = []
    for i in range(2,n+1):                             #fills prime_list with all integers  2 <= i <= n
        prime_list.append(i)
    multiple = 2                                     #set to 2 because if set to 1 it will remove all elements from the list
    while multiple <= n/multiple:
        count = 2                                    #set to 2 because if set to 1 it will remove the prime itself from the list
        while count <= n/multiple:
            if count*multiple in prime_list:         #checks if count*multiple is in list. needed because it could have already been removed
                prime_list.remove(count*multiple)    #removes count*multiple
            count += 1
        multiple += 1
    #print(prime_list)   #for testing only
    return prime_list