Creating a prime number generator, need help! - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Creating a prime number generator, need help!

irulenotirulenot Posts: 2Member
Hey guys i'm new to programming and want to join a helpful community :). I'm hoping I came to the right place hehe

so lets jump right in it

Objective: Create a program the will get me to the 1000th prime number

This is what I did so far:

raw_input ("What prime do you wish to find?" )
#input what number you wish to find here
def generator():
i = 1
while True:
yield i
i = i + 1
#a generator to produce numbers
def prime(n):
for n in range(2, i):
if i % n != 0:
print i
#a prime detector, I honestly don't know how to do this at all -___- I just copied this bad boy from another forum

I think i need to establish something that detects how many primes are on the field too, but idk how :/. Any feedback helps :)

Comments

Sign In or Register to comment.