Python Prime Number Checker Function