🚀 Hurry! Offer Ends In
00 Days
00 Hours
00 Mins
00 Secs
Enroll Now
X

q = [3,4,5,20,5,25,13] के लिए, q.pop(1) का output क्या होगा?

What will be the output of q.pop(1) for q = [3,4,5,20,5,25,13]?

A
3
B
4
C
5
D
20
Explanation

In Python, pop(index) removes the element at the given index from the list and returns it.
Python में pop(index) method किसी सूची (list) से दिए गए index पर मौजूद element को हटाता है और उसे return करता है।

Index positions in the list are:

Index:  0   1   2   3   4   5   6  
Value:  3   4   5  20   5  25  13

So, q.pop(1) will remove and return the element at index 1, which is 4.

अब q.pop(1) का मतलब है index 1 पर स्थित element को हटाना और return करना।
Index 1 पर value है: 4

इसलिए, यह statement 4 return करेगा और list से 4 हटा दिया जाएगा।

 

Correct Answer: B) 4

Latest Updates