Question
What is the output of the code shown below?import math[str(round(math.pi)) for i in range (1, 6)]
Answer: Option C
Was this answer helpful ?
The list comprehension shown above rounds off pi(3.141) and returns its value, that is 3. This is done 5 times. Hence the output is: ['3', '3', '3', '3', '3'].
Was this answer helpful ?
Submit Solution