NIELIT O Level Exam

<p>What will be the output of the following Python code?</p><pre>tuple1=(5,1,7,6,2)<br>tuple1.pop(2)<br>print(tuple1)</pre><div><br></div>

What will be the output of the following Python code?

tuple1=(5,1,7,6,2)
tuple1.pop(2)
print(tuple1)


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

tuple1=(5,1,7,6,2)
tuple1.pop(2)
print(tuple1)

A. (5,1,6,2)

B. (5,1,7,6)

C. (5,1,7,6,2)

D. Error




Correct Answer is :

D. Error



Explanation

It will generate Attribute Error: 'tuple' object has no attribute 'pop' because tuple in immutable and it can't support pop function.

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