Prime check

Write code · Basic · §2.1 Primes

Complete the function solution, which returns True if the positive integer n is prime and False otherwise.

A prime number is a number greater than 1 that is divisible only by 1 and itself.

Function

solution(n)

Constraints

Examples

nresult
7True
12False

Starter code

def solution(n):
    answer = False
    return answer

Solve this problem in your browser

Python runs in your browser and checks your answer right away. Hints and the answer are on the problem page.