Ad
Code
Diff
  • def primemaker(x):
      primes = []
      if x < 2 : return []
      else:  
        for possibleprimes in range(2,(x+1)):
            isprime = True
            for n in range(2,possibleprimes//2+1):
                if possibleprimes % n == 0:
                    isprime = False
            if isprime:
                primes.append(possibleprimes)
        return primes
    
    
    • def primemaker(x):
    • primes = []
    • if x < 2 : return []
    • else:
    • for possibleprimes in range(2,(x+1)):
    • isprime = True
    • for n in range(2,possibleprimes):
    • for n in range(2,possibleprimes//2+1):
    • if possibleprimes % n == 0:
    • isprime = False
    • if isprime:
    • primes.append(possibleprimes)
    • return primes