Explain this question

doubt 2
in this we have not given a list so it will print l.it is condition

2 Likes

Hiii @prashanshamurty99 ,
The answer to this question is option 1, because it will take values of x from range 0 to 3, for which the operation 0.5*x will be performed, and the outcome will be a list containing all the elements we got through this operation.
Thus the answer is option 1. I hope your doubt is clear now.

Regards,
Divya

2 Likes

A. [0.0, 0.5, 1.0, 2.0] its take 1st four value

1 Like

@prashanshamurty99
This problem is from list comprehension,
and it will return output for x= 0, 1, 2, 3
i.e. [0.50, 0.51, 0.52, 0.53]
so answer will be A.

1 Like