adplus-dvertising
frame-decoration

Question

What is the output of the following?
x = [i**+1 for i in range(3)]; print(x);

a.

[0, 1, 2].

b.

[1, 2, 5].

c.

error, **+ is not a valid operator

d.

error, ‘;’ is not allowed

Posted under Python

Answer: (a).[0, 1, 2].

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?