Okay, this is a little rough, but I'm still at the point where I'm happy that it's a) in Python and b) runs. For the first question:
# Returns the requested prime number
def find_nth_prime(prime_to_find):
n = 3
primes = [2]
print "%i is prime number #%i" % (primes[0], len(primes))
while len(primes) < prime_to_find:
n_is_prime = True
for prime in primes:
n_is_prime = (n%prime != 0)
if n_is_prime is False:
break
if n_is_prime:
primes = primes + [n]
print "%i is prime number #%i" % (n, len(primes))
n = n + 2
return primes[prime_to_find - 1]
prime_to_find = int(raw_input('Which prime number would you like to find?\n'))
find_nth_prime(prime_to_find)
no subject