🚀 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

q = [3, 4, 5, 20, 5, 25, 13]
print(q.pop(1))


*pop(1) → Index 1 पर जो एलिमेंट है, उसे remove करता है और return करता है।

*Indexing 0 से शुरू होती है:

Index:   0  1  2   3   4   5   6  
List:   [3, 4, 5, 20, 5, 25, 13]


*Index 1 पर value है → 4

➡️ Output: 4


q.pop(1) removes and returns the element at index 1, which is 4.

Correct Answer: B) 4

Latest Updates