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]?
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