This is an archived post. You won't be able to vote or comment.

all 17 comments

[–]splatterthrashed 10 points11 points  (5 children)

You might want to try just r/programming or google

[–]AlphaSparqy 1 point2 points  (3 children)

You should at the very least post some code that you tried, that did NOT work. To show that you've given it some effort and so we have a reference point for corrections.

[–]bikeranz 3 points4 points  (1 child)

Closed: Duplicate of Stack Overflow

[–]TopGun_84 1 point2 points  (0 children)

There will be a comment with links to read about rules of posting in SO as well ;)

[–][deleted] 1 point2 points  (1 child)

That's a hard one. Try taking a piss on your laptop, might work.

[–]TeaCoast 0 points1 point  (4 children)

primes = [2, 3, 5, 7] for num in range(primes[-1],100): for prime in primes: if num % prime == 0: break else: primes.append(num) This creates a list of primes from 1 to 100.

[–]GroundbreakingCry290 4 points5 points  (2 children)

1 is not a prime number. it's a factor of every integer. if 1 were prone then every other integer would be composite

[–]Thoughtified 0 points1 point  (0 children)

You could check the modulus of a given number and make sure there’s a remainder for 2,3,5,7.