adplus-dvertising
frame-decoration

Question

What is the output of the following code?
{a**2 for a in range(4)}

a.

{1, 4, 9, 16}

b.

{0, 1, 4, 9, 16}

c.

Error

d.

{0, 1, 4, 9}

Posted under Python

Answer: (d).{0, 1, 4, 9}

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What is the output of the following code?