Q. Find the error. Consider the following code(s) and predict the error(s):


(i) y for y in range(100) if y % 2 == 0 and if y % 5 == 0

(ii) (y for y in range(100) if y % 2 == 0 and if y % 5 == 0)


Answer =

(i)
Error is that, code should be in the form of list comprehension.

(ii)
Error is that, list comprehension not work in tuple.

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post