Lesson 17 of 34

List Methods: ചേർക്കൂ, നീക്കൂ, Sort ചെയ്യൂ

9 min 25 XP

append() അവസാനം ചേർക്കുന്നു, insert() ഒരു സ്ഥാനത്ത് ചേർക്കുന്നു, remove() ഒരു value നീക്കുന്നു, 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

Spaces കൊണ്ട് വേർതിരിച്ച സംഖ്യകളുടെ ഒരു വരി നൽകിയിട്ടുണ്ട് (Input box കാണൂ). ഏറ്റവും വലുതും ചെറുതും തമ്മിലുള്ള വ്യത്യാസം (max - min) print ചെയ്യൂ.

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