Finding nth prime number code in python