CodeTestValidate

No installations needed! Write Python directly in your browser and get instant feedback with our smart validation system.

Challenge # 1

Prime Number Checker

Objective

Determine whether a given number is a prime.

Instructions

  • You are given an integer variable n.

  • A prime number is a number greater than 1 that has no positive divisors other than 1 and itself.

  • Check if n is a prime number.

  • Print Prime if the number is prime.

  • Print Not prime otherwise.

Constraints:
Do not use input(). • `n` will be a non-negative integer.
Exemple IO

Input: n = 7

Output: Prime

Input: n = 4

Output: Not prime

Input: n = 1

Output: Not prime

Input: n = 2

Output: Prime

Try It Online!

Output:

Validate Your Results

Get your code reviewed and validated to understand what you did right and where you can improve.

Previous challengeReverse a String Without Built-in FunctionsNext challengeGCD Calculator using Euclid’s Algorithm