@@ -0,0 +1,1349 @@
+#!/Applications/anaconda/envs/Python3/bin%0A%0Aimport math%0A%0Adef main():%0A    # Test suite%0A    tests = %5B%0A        %5BNone, None%5D, # Should throw a TypeError%0A        %5B98.6, None%5D, # Should throw a TypeError%0A        %5B20, %5B2, 3, 5, 7, 11, 13, 17, 19%5D%5D%0A    %5D%0A%0A    for item in tests:%0A        try:%0A            temp_result = generate_primes(item%5B0%5D)%0A            if temp_result == item%5B1%5D:%0A                print('PASSED: generate_primes(%7B%7D) returned %7B%7D'.format(item%5B0%5D, temp_result))%0A            else:%0A                print('FAILED: generate_primes(%7B%7D) returned %7B%7D, should have returned %7B%7D'.format(item%5B0%5D, temp_result, item%5B1%5D))%0A%0A        except TypeError:%0A            print('PASSED TypeError test')%0A%0A    return 0%0A%0A%0Adef generate_primes(max_num):%0A    '''%0A    Generates a list of prime numbers up to the given max number%0A    Input: int%0A    Output: list of ints%0A    '''%0A    if type(max_num) is not int:%0A        raise TypeError('Input must be an integer')%0A%0A    primes = %5B%5D%0A%0A    if max_num %3C= 1:%0A        return primes%0A%0A    primes.append(2)%0A    for n in range(3, max_num + 1, 2):%0A        primes.append(n) # assume it's prime%0A        square_root = math.ceil(math.sqrt(n))%0A        for d in range(2, square_root + 1):%0A            if n %25 d == 0:%0A                primes.pop() # Not prime, remove%0A                break%0A%0A    return primes%0A%0A%0Aif __name__ == '__main__':%0A    main()%0A

Add generatePrimes problem and tests