Question 231 markShort AnswerSection B

To create a new list L1 containing the elements of list L arranged in ascending order, without modifying list L.

Python Revision Tour
Sorting a List — sorted()

Official answer

Required statement:

``python

L1 = sorted(L)

`

The built-in sorted() function returns a NEW list containing the elements of L arranged in ascending order, while leaving the original list L` completely unchanged.

Answer keywords:sorted() functionlist sortingascending ordernon-destructive sortL.sort() vs sorted(L)built-in functionPython lists

Marking scheme

  1. 1.1 mark for the correct statement `L1 = sorted(L)`; equivalent forms like `L1 = sorted(L, reverse=False)` also accepted.

Hint

Use the function that RETURNS a new sorted list rather than the method that sorts the list in place.

Quick oral answer

L1 = sorted(L) creates a new ascending-order list from L without changing L, because sorted() always returns a fresh list rather than sorting in place.

Common mistakes

  1. 1.Writing `L1 = L.sort()`, which sorts L in place and stores `None` in L1 — this fails to create a separate ascending list and also modifies L.
  2. 2.Assuming `sorted()` modifies the original list L, when in fact it only returns a new list, leaving L unchanged.

Analysis and explanation

This question tests the important distinction between Python's sort() method and sorted() function.


Why sorted(L) is the correct choice

  • sorted(L) takes any iterable and returns a brand-new sorted list, by default in ascending order.
  • The original list L is never modified by sorted(), satisfying the requirement to leave L untouched.

Common confusion

  • L.sort() sorts the list L IN-PLACE and returns None — using L1 = L.sort() would incorrectly make L1 equal to None while also modifying L, which violates the question's condition.

Interesting facts

Python's built-in sort (used internally by both `sort()` and `sorted()`) is called Timsort, a hybrid of merge sort and insertion sort designed for real-world data.

`sorted()` works on ANY iterable — lists, tuples, strings, dictionaries (sorts keys) — always returning a list, unlike `sort()` which is a list-only method.

Question details

Q23 of 48 questions

Board
CBSE
Class
Class 12
Subject
Computer Science
Year
2026
Section
Section B
Marks
1
Type
Short Answer
Chapter
Python Revision Tour
Topic
Sorting a List — sorted()
Bloom's level
apply
Syllabus topic
Unit 1: Computational Thinking and Programming — Lists (Built-in Function: sorted())
Author
CBSE
Reviewed by
Padhantu Academic Team

Spotted a mistake or something unclear?

Tell us and we will fix it.

Frequently asked questions

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

L.sort() sorts the list L in place and returns None, modifying the original list. sorted(L) returns a brand-new sorted list and leaves L unchanged.

How do you sort a list in descending order using sorted()?

Pass the reverse=True argument: L1 = sorted(L, reverse=True).