Lesson 17 of 34

List Methods: जोड़ना, हटाना, क्रम में लगाना

9 min 25 XP

append() आख़िर में जोड़ता है, insert() किसी स्थान पर जोड़ता है, remove() कोई मान हटाता है, और pop() आख़िरी item निकालता है।

Example: edit me and press Run

Output Loading Python (first time takes a few seconds)
Press Run to see the result here.

संख्याओं की list के लिए sum(), max() और min() बहुत काम के हैं। sort() छोटे से बड़े क्रम में लगाता है; sort(reverse=True) उल्टा।

Example: edit me and press Run

Output Loading Python (first time takes a few seconds)
Press Run to see the result here.

एक लाइन से कई संख्याएँ पढ़ने के लिए: input().split() strings की list देता है; हर एक को int में बदलें।

Example: edit me and press Run

Output Loading Python (first time takes a few seconds)
Press Run to see the result here.

Challenge

+25 XP

space से अलग की गई संख्याओं की एक लाइन दी गई है (Input box देखें)। सबसे बड़ी और सबसे छोटी का अंतर (max - min) print करें।

Output Loading Python (first time takes a few seconds)
Press Run to see the result here.