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?
for i in [1, 2, 3, 4][::-1]:
print (i)

What will be the output of the following Python code snippet?
for i in [1, 2, 3, 4][::-1]:
print (i)
a) 1 2 3 4
b) 4 3 2 1
c) error
d) none of the mentioned

Answer: b
Explanation: [::-1] reverses the list.

Join The Discussion