Bird
Raised Fist0

What will be the output of this code?

medium📝 Predict Output Q4 of Q15
Python - Standard Library Usage
What will be the output of this code?
import math
print(math.sqrt(16))
A4.0
B16
CError: sqrt not found
DNone
Step-by-Step Solution
Solution:
  1. Step 1: Understand the math.sqrt function

    math.sqrt(16) calculates the square root of 16, which is 4.0.
  2. Step 2: Check the output of print statement

    It prints the float value 4.0 to the screen.
  3. Final Answer:

    4.0 -> Option A
  4. Quick Check:

    math.sqrt(16) = 4.0 [OK]
Quick Trick: math.sqrt returns float square root [OK]
Common Mistakes:
MISTAKES
  • Expecting integer 4 instead of float 4.0
  • Thinking sqrt is not in math module

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Python Quizzes