Lesson 15. **abs()**

I didn't expect this to work, why does it work?

```
absolute = abs(42)
print absolute
```

Lesson 15. **abs()**

I didn't expect this to work, why does it work?

```
absolute = abs(42)
print absolute
```

It works because `abs()`

is a built in function that returns the absolute value of a given number.

Well that is simply because Codecademy's SCT was testing for `absolute`

to be equal to `42`

.

If`|42| = 42`

and`|-42| = 42`

then`|42| = |-42|`

The SCT got the result it wanted and accepted your code.

The SCT or Submission Correctness Test is the lesson checker program behind the exercise.

Good, I'm glad you understand.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.