LearnPy Hub
← If…Else problems
Easy

Absolute Value

Read an integer and print its absolute value using an if statement (not abs()).

Input

One integer.

Output

A non-negative integer.

Sample 1

Input
-5
Output
5

Sample 2

Input
5
Output
5
solution.py
Output appears here
Absolute Value · Python practice problem · LearnPy Hub