सूची में किसी विशिष्ट आइटम को कैसे निकालें

कोड उदाहरण

14
0

सूची पायथन से आइटम निकालें

# removes item with given name in list
list = [15, 79, 709, "Back to your IDE"]
list.remove("Back to your IDE")

# removes last item in list
list.pop()

# pop() also works with an index...
list.pop(0)

# ...and returns also the "popped" item
item = list.pop()
2
0

पायथन में सूची से किसी विशेष तत्व को कैसे हटाएं

# animals list
animals = ['cat', 'dog', 'dog', 'guinea pig', 'dog']

# 'dog' is removed
animals.remove('dog')

# Updated animals list
print('Updated animals list: ', animals)
0
0

सूची से आइटम हटाएं

listname.remove(element)

इसी तरह के पन्ने

उदाहरणों के साथ समान पृष्ठ

अन्य भाषाओं में

यह पृष्ठ अन्य भाषाओं में है

Русский
..................................................................................................................
English
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................

इस श्रेणी में लोकप्रिय

श्रेणी में उदाहरण के साथ लोकप्रिय पृष्ठों