What will be the output of the following Python code snippet? for i in [1, 2, 3, 4][::-1]: print (i)

Questions & AnswersCategory: Programming LanguageWhat will be the output of the following Python code snippet? for i in [1, 2, 3, 4][::-1]: print (i)
Geek Boy Staff asked 2 years ago

What will be the output of the following Python code snippet?

for i in [1, 2, 3, 4][::-1]:
    print (i)

a. 4 3 2 1
b. error
c. 1 2 3 4
d. none of the mentioned