Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

What will be the output of the following Python code snippet?
print([if i%2==0: i; else: i+1; for i in range(4)])

What will be the output of the following Python code snippet?
print([if i%2==0: i; else: i+1; for i in range(4)])
a) [0, 2, 2, 4]
b) [1, 1, 3, 3]
c) error
d) none of the mentioned

Answer: c
Explanation: Syntax error.

Join The Discussion