Absolute Value in Python
Level 115 keystrokes
This prints the absolute value of -42, which is 42. The abs() function removes the negative sign.
Python code
# abs() returns the absolute value: the distance from zero, never negative# abs(-42) drops the minus sign and returns 42, which is printed1print(abs(-42))Output
42
Practice typing this code. Results are not recorded in the rankings.
Symbols in this code
The symbols you type in this Python code and how often they appear.
(× 2)× 2-× 1