1. Home
  2. Data Science
  3. Python
  4. What is the correct way to import a module named "math" in…

Added 27 Jan 2024

What is the correct way to import a module named "math" in Python?

  1. import math Correct answer
  2. include math
  3. require math
  4. use math

Correct answer

A. import math

17 views

MCQSEXAM

Explanation

import math loads Python's built-in math module, after which its contents are used with dot notation, e.g. math.sqrt(16) or math.pi.

You can also write from math import sqrt or give an alias with import math as m. include, require and use are keywords of other languages.

For more solved questions like this one, see Computer Science MCQs on MCQsExam.com.

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