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.
CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online Exam Quiz O Level NIELIT Study material and Quiz Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Best Website and Software Company in Allahabad Website development Company in Allahabad