Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def prime(n=100):
- chart = range(3,n+1,2)
- i,p = 0,3
- while p**2 < n:
- for x in chart[i+1:]:
- if x%p == 0:
- chart.remove(x)
- i += 1
- p = chart[i]
- if n == 9: chart.pop()
- chart.insert(0,2)
- return chart
Advertisement
Add Comment
Please, Sign In to add comment