1. Home
  2. Data Science
  3. Python
  4. What is the output of the following Python code snippet?

Added 25 Nov 2026

What is the output of the following Python code snippet?

import math
print(math.pi)
  1. 3.141592653589793 Correct answer
  2. 3.14
  3. 3
  4. Error

Correct answer

A. 3.141592653589793

MCQSEXAM

Explanation

math.pi holds the value of pi as a float.

Reference

Asked in: Python Interview Standard Library

https://docs.python.org/3/library/index.html

Preparing for an exam?

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