Question 4
Back to Exercise
What is the output of the following Python program?
import sys
import math
import math as again
print(again is math, "math" in sys.modules, sys.modules["math"] is math)
- A False True False
- B True False True
- C False False False
- D True True True Correct
Correct Answer: Option D
Every import of math returns the single module object cached in sys.modules.
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!