Lesson 17 of 34
List Methods: சேர், நீக்கு, வரிசைப்படுத்துList Methods: Add, Remove, Sort
9 min 25 XP
append() கடைசியில் சேர்க்கும், insert() குறிப்பிட்ட இடத்தில் சேர்க்கும், remove() ஒரு மதிப்பை நீக்கும், pop() கடைசி மதிப்பை எடுத்துக் கொடுக்கும்.
append() adds to the end, insert() adds at a position, remove() deletes a value, and pop() takes out the last item.
Example: edit me and press Run
Press Run to see the result here.எண்கள் உள்ள list-க்கு sum(), max(), min() மிகவும் பயனுள்ளவை. sort() சிறியதிலிருந்து பெரியதாக வரிசைப்படுத்தும்; sort(reverse=True) தலைகீழாக.
For number lists, sum(), max() and min() are very handy. sort() orders from small to large; sort(reverse=True) does the opposite.
Example: edit me and press Run
Press Run to see the result here.ஒரே வரியில் space விட்டு பல எண்களைப் பெற: input().split() ஒரு list தரும்; ஒவ்வொன்றையும் int ஆக்க வேண்டும்.
To read many numbers from one line: input().split() gives a list of strings; convert each one to int.
Example: edit me and press Run
Press Run to see the result here.