WebMD Medscape content tooling uses numeric revision tokens that may need prime-number validation before processing. Write a function that determines whether a given integer is prime.
A prime number is an integer greater than 1 with exactly two positive divisors: 1 and itself. Return True when n is prime and False otherwise. Your solution should avoid testing every integer up to n when a smaller search is sufficient.
n.n is prime.def is_prime(n):