Menu

Sign in to track your progress and unlock all features.

Theme style

Log in
01. Check Even or OddE02. Determine Positive, Negative, or ZeroE03. Compare Two NumbersE

Problem No 2

Determine Positive, Negative, or Zero

Easy

8 minute session

Summary

Classify a number as positive, negative, or zero using conditional branches.

Problem statement

Write a function sign_of_number(n) that inspects the number n and returns: - 'Positive' if n > 0 - 'Negative' if n < 0 - 'Zero' if n == 0 Use if-elif-else branching to implement the logic.

Task

Implement a function that returns 'Positive', 'Negative', or 'Zero' based on the sign of a number.

Examples

Example 1

Input

n = -5

Output

Negative

Explanation

-5 is less than zero.

Input format

A single integer n.

Output format

A string: 'Positive', 'Negative', or 'Zero'.

Constraints

n fits in standard integer range; can be negative, zero, or positive.

Samples

Sample input 0

5

Sample output 0

Positive

Explanation 0

5 is greater than zero.

Code editor
Loading editor…

AI assistant

Ask me anything!

Need help? I can explain the core idea behind this problem, review your current code, and give targeted hints. Use “Teach Theory” for the concept, “Get AI hint” for a quick scaffold nudge, or ask a specific question below.

Chat history is temporary and will not be saved.

12:41 PM

Free preview includes 1 Teach Theory response and 1 AI hint on each of the first 3 lessons in this module.