← Problem book: Python
Lesson 27 of 96 · 10 XP
Sign of a number
Theory and problem statement
Machine translation, not yet reviewed by a native speaker.
You are given an integer. Print 1 if it is positive, -1 if it is negative, and 0 if it is zero.
Example
Input:
42
Output:
1
Sign up for free to solve this task right in your browser: code editor, running, test checks and hints.