CodeTestValidate

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

Challenge # 3

Check if a Number is Positive, Negative, or Zero

Objective

Determine whether a given number is positive, negative, or zero.

Instructions

  • You are given an integer variable n.

  • Check if the number is positive, negative, or zero.

  • Print 'Positive' if the number is greater than 0.

  • Print 'Negative' if the number is less than 0.

  • Print 'Zero' if the number is equal to 0.

Constraints:
Do not use input(). • `n` will be an integer.
Exemple IO

Input: n = 5

Output: Positive

Input: n = -3

Output: Negative

Input: n = 0

Output: Zero

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 challengeAdd Two NumbersNext challengePrint Multiplication Table
Loading...