NIELIT O Level Exam

<p>What will be the output of the following Python code snippet?</p><pre>for i in [1, 2, 3, 4][::-1]:<br>&nbsp; &nbsp; print (i)</pre><div><br></div>

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

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


निम्नलिखित पायथन कोड स्निपेट का आउटपुट क्या होगा?

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 उल्लेखित कोई नहीं




Correct Answer is :

B. 4 3 2 1



Explanation
[::-1] reverses the list.
Latest Current Affairs 2025 Online Exam Quiz for One day Exam Online Typing Test CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online MBA 2 years Online MCA Online BCA Best Website and Software Company in Allahabad