1. Home
  2. Data Science
  3. Python
  4. What is the result of abs(-5) in Python?

Added 4 May 2024

What is the result of abs(-5) in Python?

  1. 5 Correct answer
  2. -5
  3. 0
  4. Error

Correct answer

A. 5

15 views

MCQSEXAM

Explanation

The abs() function returns the absolute value of a number, so abs(-5) equals 5.

Doubts & discussion

Not sure why the answer is A? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More Python MCQs

Practise all Python MCQs

Similar MCQs