Code
Diff
  • def primemaker(x):
        if x<2: return []
        primes = [2]
        for possibleprimes in range(3,x+1, 2):
            for n in range(2,int(possibleprimes**0.5)+1):
                if possibleprimes % n == 0:
                    break
            else:
                primes.append(possibleprimes)
        return primes
  • 11
    def primemaker(x):
    
    2
        primes = []
    
    3
        isprime = True
    
    4
        for possibleprimes in range(2,x):
    
    5
            for n in range(2,possibleprimes):
    
    6
                if possibleprimes % num == 0:
    
    7
                    isprime = False
    
    8
            if isprime:
    
    2+
        if x<2: return []
    
    3+
        primes = [2]
    
    4+
        for possibleprimes in range(3,x+1, 2):
    
    5+
            for n in range(2,int(possibleprimes**0.5)+1):
    
    6+
                if possibleprimes % n == 0:
    
    7+
                    break
    
    8+
            else:
    
    99
                primes.append(possibleprimes)
    
    10
        print(primes)
    
    11
    10+
        return primes