Single Choice Not Set

QWhat will be the output after the following statements?
from math import pi
a = [str(round(pi, i)) for i in range(0,5)]
print(a)

ID: #3880 Python for Loop MCQ 232 views
Question Info
#3880Q ID
Not SetDifficulty
Python for Loop MCQTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A [3.0, 3.1, 3.14, 3.142, 3.1416]
  • B ['3.0', '3.1', '3.14', '3.142']
  • C ['3.0', '3.1', '3.14', '3.142', '3.1416']
  • D ['3.1', '3.14', '3.142', '3.1416']
Correct Answer

Explanation

['3.0', '3.1', '3.14', '3.142', '3.1416']

Share This Question

Challenge a friend or share with your study group.