CBSE 2026 results are out, Mukul scored a perfect 100/100 in Computer ScienceSee all toppers →

KwickAcademy Python · 7 min · free

List Methods and Built-in Functions

7 min5 KwickClipsFull text belowFree
Next lesson →Kajal Ma'am (MCA), teaching since 2004Remembered in this browser

Learn Python list methods and functions for CBSE Class 11: append, extend, insert, remove, pop, sort vs sorted, min, max, sum. A method belongs to the list and is written with a dot, like marks.append(80); a function takes the list inside brackets, like len(marks).

Follows the syllabus of: CBSE Class 11 Computer Science (083), CBSE Class 11 Computer Science Essentials (083), CBSE Class 11 Informatics Practices (065)

On screen in this lesson

Functions and methods

A list holds many values in [ ], and it can change
Function: name first, list inside, like len(marks)
Method: list first, then a dot, like marks.append(80)
Some tools change the list; some return a new value

Errors to remember

remove() of a missing value gives ValueError
index() of a missing value gives ValueError
pop() on an empty list gives IndexError
pop(10) on a short list gives IndexError

Changes the list or not?

ToolChanges list?Gives back
append, extendYesNone
insert, removeYesNone
sort, reverseYesNone
popYesremoved item
sortedNonew list
len, count, sumNoa number

Quick recap

append adds one item; extend adds many; insert adds at an index
remove deletes by value; pop deletes by index and returns it
count, index and len only look at the list
sort() changes the list; sorted() gives a new list
min, max and sum work on numbers

Quick answers

What is the difference between sort() and sorted()?

sort() changes the same list and returns None; sorted() gives a new list and keeps the original.

What does pop() return?

The removed item. With empty brackets it removes the last item.

KwickClips from this lesson

Short clips, one idea each. Good for revision the night before.

The full lesson, in text

Hello students, welcome to Kwickprep. Your list of marks is ready. How do you add a new mark, remove a wrong one, or find the topper? Python has ready tools for all of this. Today we will learn the most used list methods and built-in functions, and one trap that exams love.

First, two new words. A list holds many values inside square brackets, and we can change it. A built-in function is a ready tool, where we write the name first and put the list inside the brackets. A method is a tool that belongs to the list, so we write the list, then a dot, then the method name. Some tools change the list itself, and others only give back a new value.

Len gives the length, which is the number of items. Len of marks is three. The list function builds a new list from other values. List of the word cat gives a list of its three letters. List of range of three gives zero, one and two.

Think of a grocery cart. Append adds one item at the end of the list. Cart dot append oil puts oil after dal. It changes the cart itself, so we do not need to store anything new.

Extend looks similar, but it works differently. Append always adds exactly one item. So appending the list three, four puts a whole list inside, as one item. Extend takes each item from the other list and adds them one by one. So second becomes one, two, three, four.

Insert adds an item at a chosen index, which is the position number starting from zero. It takes two values, the index and the item. Queue dot insert one, Aman puts Aman at index one, and Neha moves one step right. Pause and predict. What happens if the index is ten, far past the end? There is no error. Dev simply goes to the end.

Here are the runs from six balls of a cricket over. Count tells how many times a value appears. Four appears three times. Index tells the position of the first match. The first four is at index zero, and zero runs is at index four. If the value is not in the list, index gives a value error.

Remove deletes an item by its value. Bag dot remove pen deletes only the first pen. Pop deletes an item by its position and also gives it back to you. With empty brackets, pop takes the last item, gum. Pop of zero takes the item at index zero, which is now ink. Only one pen is left.

Exams often ask which line gives an error. Remove of a value that is not in the list gives a value error. Index of a missing value also gives a value error. Pop on an empty list gives an index error. And pop of an index that does not exist also gives an index error.

Reverse flips the order of the items in the same list. The train goes from Delhi to Agra to Jhansi. For the return journey, stops dot reverse gives Jhansi, Agra, Delhi. It does not sort anything, it only flips.

Sort arranges the items of the same list in order. Sort with empty brackets goes from smallest to largest. To go from largest to smallest, write reverse equals True inside the brackets. After sort, the old order is gone.

Sorted is a built-in function, not a method. It gives back a new sorted list and leaves the original list as it was. Ranked is sixty five, seventy eight, ninety two. Marks still has its old order. Use sorted when you want to keep the original.

Now the trap. Sort changes the list, but it returns nothing. In Python, nothing is written as None. So result is None, while marks is sorted. Append, extend, insert, remove and reverse also return None. Never store their result expecting a list.

These three built-in functions work on a list of numbers, like a canteen bill. Min gives the smallest, twenty. Max gives the largest, sixty. Sum adds them all, one hundred twenty. Sum divided by len gives the average, forty point zero. On a list of words, min and max compare letter by letter, and capital letters come before small letters. But sum of words gives a type error.

This table is the key idea of the lesson. Append and extend change the list and give back None. Insert and remove also change the list and give back None. Sort and reverse change the list in place, and give back None too. Pop changes the list, and gives back the removed item. Sorted does not change the list, and gives a new list. Len, count and sum do not change the list, and give back a number.

Let us revise what we learned today. Append adds one item, extend adds many, and insert adds at a chosen index. Remove deletes by value, while pop deletes by index and returns the item. Count, index and len only look at the list, without changing it. Sort changes the list, but sorted gives a new list. Min, max and sum work on a list of numbers. Try each method on your own list and predict the output first.

Courses that teach this

CourseUnit
CBSE Class 11 Computer Science (083)Computational Thinking and Programming - I
CBSE Class 11 Computer Science Essentials (083)Computational Thinking and Programming - I
CBSE Class 11 Informatics Practices (065)Introduction to Python
Programming All levels PythonData Structures

Voice-over in this lesson is AI-generated. The script is written and checked by Kajal Ma'am. Boards can revise a syllabus mid-year, so confirm anything you plan around against the official board circular. Keep your passwords, OTPs and ID numbers to yourself — we never ask for them. To reach Kajal Ma'am, use the WhatsApp button; sharing your number there is how we call you back.

Free to watch, no sign-up. Live classes with Kajal Ma'am are the paid course; these lessons stay free either way.

Want a plan that actually fits your board dates?

Ask Kajal Ma'am directly, 20+ years teaching computer science. Free demo class first, no payment.

Talk to Kajal Ma'am on WhatsApp

Or see the Class 12 Computer Science course →

Studying outside India?

We coach CBSE, IGCSE & international students across the globe, one-to-one, in your local time zone.

Visit International →