1. Home
  2. Data Science
  3. Python
  4. What does the underscore _ hold in the interactive…

Added 25 Nov 2026

What does the underscore _ hold in the interactive interpreter in Python?

  1. The last error
  2. The result of the last expression Correct answer
  3. The current directory
  4. A private variable

Correct answer

B. The result of the last expression

MCQSEXAM

Explanation

In the REPL, _ stores the value of the previous expression.

Reference

Asked in: Python Interview Basics

https://docs.python.org/3/tutorial/introduction.html

Preparing for an exam?

Doubts & discussion

Not sure why the answer is B? 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