Edzy
AI TutorResourcesToolsCompareBuy
SearchDownload AppLogin
Edzy

Edzy for Classes 6-12

Edzy is a personal AI tutor for CBSE and State Board students, with curriculum-aligned guidance, practice, revision, and study plans that adapt to each learner.

  • Email: always@edzy.ai
  • Phone: +91 96256 68472
  • WhatsApp: +91 96256 68472
  • Address: Sector 63, Gurgaon, Haryana

Follow Edzy

Browse by Class

  • CBSE Class 6
  • CBSE Class 7
  • CBSE Class 8
  • CBSE Class 9
  • CBSE Class 10
  • CBSE Class 11
  • CBSE Class 12
Explore the CBSE resource hub

Explore Edzy

  • Study Resources
  • Free Study Tools
  • Best Apps for Board Exams
  • Edzy vs ChatGPT
  • About Us
  • Why We Built Edzy
  • Blog
  • CBSE AI Tutor

Support & Legal

  • Help & FAQs
  • Accessibility
  • Privacy Policy
  • Terms & Conditions
  • Refund Policy
  • Cookie Policy
  • Site Directory

© 2026 Edzy. All rights reserved.

Curriculum-aligned learning paths for students in Classes 6-12.

CBSE
Class 11
Informatics Practices
Informatics Practices
Working with Lists and Dictionaries

Worksheet

Practice Hub

Worksheet: Working with Lists and Dictionaries

This chapter explores lists and dictionaries, two essential data structures in programming, explaining their functions and importance for data manipulation.

Structured practice

Working with Lists and Dictionaries - Practice Worksheet

Strengthen your foundation with key concepts and basic applications.

This worksheet covers essential long-answer questions to help you build confidence in Working with Lists and Dictionaries from Informatics Practices for Class 11 (Informatics Practices).

Practice Worksheet

Practice Worksheet

Basic comprehension exercises

Strengthen your understanding with fundamental questions about the chapter.

Questions

1

Define a list in Python. Explain its characteristics and provide examples of different types of lists.

A list in Python is an ordered collection of items, defined by square brackets. It is mutable, allowing modifications such as adding or removing elements. An example of a list with integers is: myList = [1, 2, 3]. A list can also contain mixed data types, such as myList = [1, 'Hello', 3.14]. Nested lists are also possible, like myNestedList = [[1, 2], ['a', 'b']].

2

What are the operations that can be performed on lists in Python? Explain with examples.

Basic operations on lists include concatenation, repetition, membership tests, slicing, and various built-in functions. For example, concatenation can be done using the + operator like list1 + list2. Repetition can be achieved using * like list1 * 3. Membership is checked with 'in', e.g., 5 in list1. Slicing allows sub-list creation, such as list1[1:3].

3

Describe how to access elements in a list using both positive and negative indexing. Provide examples.

You can access elements in a list by indexing, where indexing starts from 0 for the first element. For instance, myList[0] returns the first element, and myList[2] returns the third element. Negative indexing begins from the end of the list, where -1 accesses the last element. For example, if myList = [10, 20, 30], then myList[-1] returns 30.

4

Explain how Python lists support slicing and provide examples of different slicing techniques.

Slicing in Python allows you to extract a subset of a list. You can specify the start, stop, and step. For instance, myList[1:4] gets elements from index 1 to 3. Using myList[1::2] takes every second element from index 1 onwards. You can also slice in reverse using myList[::-1], which returns the list in reverse order.

5

What are dictionaries in Python? Discuss their characteristics with examples.

Dictionaries in Python are unordered collections of key-value pairs defined within curly braces. Each key is unique and maps to a value. An example is: myDict = {'name': 'Alice', 'age': 25}. Dictionaries are mutable, allowing modification of values, such as myDict['age'] = 26. Keys can be of any immutable data type.

6

How can you access items in a dictionary? Provide examples.

Items in a dictionary are accessed using keys. For example, if myDict = {'name': 'Bob', 'age': 30}, accessing myDict['name'] returns 'Bob'. If you try to access a key not present in the dictionary, it raises a KeyError. Use the 'get' method to avoid this error, as in myDict.get('height') which will return None if 'height' is not found.

7

Discuss the mutability of dictionaries and provide an example showing how to add and modify items.

Dictionaries are mutable, meaning you can add or change key-value pairs. For example, starting with myDict = {'Apple': 1}, you can add a new item with myDict['Orange'] = 2, resulting in myDict becoming {'Apple': 1, 'Orange': 2}. To modify, you can do myDict['Apple'] = 5, changing the value associated with 'Apple' to 5.

8

Explain dictionary methods such as keys(), values(), and items() with examples.

The keys() method returns a view object of all the keys in the dictionary. For example, myDict.keys() gives dict_keys(['name', 'age']). The values() method returns a view object of all values, such as myDict.values() producing dict_values(['Bob', 30]). The items() method returns a view of pairs, like myDict.items() resulting in dict_items([('name', 'Bob'), ('age', 30)]).

9

What is the difference between shallow copy and deep copy of a list? Provide examples.

A shallow copy of a list creates a new list but does not create copies of nested objects; it just copies references. For instance, if a = [[1, 2], [3, 4]], b = a.copy() modifies b[0][1] also affects a, showing they reference the same inner list. A deep copy, using import copy and copy.deepcopy(a), creates a completely independent copy, so changing b won't affect a.

10

How can you implement a program to count the frequency of elements in a list?

You can use a dictionary to track occurrences. Initialize an empty dictionary and iterate through the list, increasing counts for each element seen. For example: myList = [1, 2, 2, 3], for item in myList: count[item] = count.get(item, 0) + 1. This creates a frequency map indicating how many times each element appears.

Learn Better On The App
Competitive revision

Challenge Your Friends

Compete in short duels with fast rounds, instant feedback, and zero boredom.

1v1 challenges
Fast recall training

Faster access to practice, revision, and daily study flow.

Edzy mobile app preview

Working with Lists and Dictionaries - Mastery Worksheet

Advance your understanding through integrative and tricky questions.

This worksheet challenges you with deeper, multi-concept long-answer questions from Working with Lists and Dictionaries to prepare for higher-weightage questions in Class 11.

Mastery Worksheet

Mastery Worksheet

Intermediate analysis exercises

Deepen your understanding with analytical questions about themes and characters.

Questions

1

Explain how lists are mutable in Python. Demonstrate this with an example that modifies elements within a list, and discuss the implications of mutability with references to data types.

Lists in Python are mutable, allowing us to change their contents after creation. For example, consider `myList = ['a', 'b', 'c']`. After the assignment, modifying `myList[1] = 'd'` results in `['a', 'd', 'c']`. This mutability signifies that the list reference can lead to unintended side effects if shared across functions.

2

Compare the use of the `append()` and `extend()` methods for lists with examples. Illustrate scenarios where each should be used.

The `append()` method adds a single element to a list, while `extend()` adds elements from an iterable to the end of the list. For instance: `listA = [1, 2]` after `listA.append([3, 4])` becomes `[1, 2, [3, 4]]`, but after `listA.extend([3, 4])`, it becomes `[1, 2, 3, 4]`. Use `append()` when you want to add a single element, and `extend()` when merging lists.

3

Discuss slicing in lists. Provide a comprehensive example that retrieves sublists using both positive and negative indexing.

Slicing allows us to obtain a subset of a list. For example, given `listA = [10, 20, 30, 40, 50]`, `listA[1:4]` returns `[20, 30, 40]`, while `listA[-3:]` gives `[30, 40, 50]`. Negative indexing enables access from the end of the list.

4

Create a program that shifts elements in a list by one position to the left. Include explanations of the hovering differences between index assignment and using a method like `insert()`.

To shift elements left, we can create a loop or slice. For example: `original = [1, 2, 3, 4]` results in `shifted = original[1:] + original[:1]`, giving `[2, 3, 4, 1]`. Index assignment modifies the list in place, while method calls like `insert()` can manipulate content differently.

5

Explain the concept of dictionaries in Python. How do key-value pairs support data retrieval? Provide an example that demonstrates adding, updating, and deleting keys.

Dictionaries store data as key-value pairs for quick access. For example: `dictA = {'name': 'John'}` shows `dictA['name']` returns 'John'. To add `dictA['age'] = 30` updates it to `{'name': 'John', 'age': 30}`. Deleting with `del dictA['name']` results in `{'age': 30}`.

6

Demonstrate the functionality of the `get()` and `pop()` methods in dictionaries. Compare their outputs with situations where keys may or may not exist.

`get()` retrieves a value without raising errors if a key does not exist, while `pop()` removes the key-value pair. For instance, in `dictB = {'x': 10}`, `dictB.get('y', 'default')` returns 'default', whereas `dictB.pop('y', 'not found')` raises a KeyError unless handled. This illustrates safe access vs. modification.

7

List and explain some built-in dictionary methods. Provide an example that showcases at least three of these methods in action.

Built-in methods such as `keys()`, `values()`, `items()`, and `update()` facilitate manageability of dictionaries. For example, `dictC = {'a': 1, 'b': 2}` shows `dictC.keys()` yields `dict_keys(['a', 'b'])`, whereas `dictC.update({'c': 3})` adds a new entry.

8

Write a Python function that merges two dictionaries. Discuss handling key collisions and strategies for prioritizing one dictionary’s values over another’s.

To merge two dictionaries, we can use `dictC.update(dictD)`. If a collision occurs, the latter dictionary retains its value. To prioritize `dictC`, one could iterate and handle keys: `for k in dictD: dictC.setdefault(k, dictD[k])`.

9

What are nested dictionaries? Provide an example where one dictionary contains another dictionary, and demonstrate accessing nested elements.

Nested dictionaries allow complex data structures. For instance, `dictE = {'person': {'name': 'Alice', 'age': 25}}` shows access through `dictE['person']['name']`, yielding 'Alice'. It’s crucial for modeling real-world data.

10

Apply list comprehensions to create a list that contains the squares of all even numbers between 1 and 20. Provide a commentary on the efficiency of such a method over traditional loops.

[x**2 for x in range(1, 21) if x % 2 == 0] generates [4, 16, 36, 64, 100, 144, 196] efficiently, as opposed to using loops, improving code clarity and performance. It’s a concise, readable manner to generate lists.

Working with Lists and Dictionaries - Challenge Worksheet

Push your limits with complex, exam-level long-form questions.

The final worksheet presents challenging long-answer questions that test your depth of understanding and exam-readiness for Working with Lists and Dictionaries in Class 11.

Challenge Worksheet

Challenge Worksheet

Advanced critical thinking

Test your mastery with complex questions that require critical analysis and reflection.

Questions

1

Critically analyze the impact of list mutability in Python on data integrity. How can it lead to unintentional data loss in applications that require data permanence?

Discuss the implications of mutable data types such as lists, using examples of unintended mutation. Address safeguards that can be implemented to maintain data integrity.

2

Design a case study where you utilize a list of student marks to calculate and visualize their performance trends. How do different list manipulations affect the insight gathered?

Outline steps to analyze marks and present them, emphasizing operations like sorting, slicing, and calculations on lists.

3

Evaluate the trade-offs between using lists and dictionaries for mapping scores to student names in educational applications. When might one be preferred over the other?

Focus on time complexity, data retrieval efficiency, and clarity of code when using lists versus dictionaries.

4

Propose a solution using dictionaries to maintain a record of student grades that allows for frequent updates. What potential challenges could arise from this approach?

Identify methods to implement such a system and evaluate challenges like handling duplicates or concurrent modifications.

5

Create a program outline that uses both lists and dictionaries to manage a collection of books in a library system. What operations would you prioritize?

Discuss how lists can keep track of available books, while dictionaries map book details, focusing on the usefulness of each data structure for various operations.

6

Analyze a list manipulation error where an IndexError is raised. In what situations is this type of error most common, and how can you prevent it?

Explain the scenarios leading to IndexErrors, describe methods for prevention, and suggest best practices for safe list manipulation.

7

Discuss how slicing can be utilized to retrieve sublists of student data, such as honors and at-risk students, from a larger list of grades. What does this reveal about performance segmentation?

Provide a method to code this functionality and interpret the outcomes based on sliced data.

8

Critique the use of the 'in' keyword with lists versus dictionaries for membership testing in terms of efficiency and readability.

Evaluate both methods, providing examples and reasoning about their performance implications.

9

Explore advanced list methods such as extend, insert, and remove. How can improper use lead to data loss or corruption in a critical application?

Detail the operations' functionalities, pitfalls, and recommend careful coding practices.

10

Formulate a dictionary-based application that tracks student attendance. How could you optimize data storage and retrieval in a high-traffic environment?

Lay out a structure for storing attendance and evaluate how to ensure efficient access and updates.

Chapters related to "Working with Lists and Dictionaries"

Computer System

This chapter provides an insight into computer systems, including their components, importance, and evolution.

Start chapter

Emerging Trends

This chapter covers the emerging trends in technology, focusing on their significance and impact on society.

Start chapter

Brief Overview of Python

This chapter provides an overview of Python, a popular programming language, and its fundamental concepts necessary for building software.

Start chapter

Understanding Data

This chapter introduces the concept of data, its collection, storage, processing, and statistical techniques used for analysis. Understanding data is critical in various fields for effective decision-making.

Start chapter

Introduction to NumPy

This chapter introduces NumPy, a key library for numerical computing in Python, focusing on its array structure and operations.

Start chapter

Database Concepts

This chapter explores database concepts crucial for managing data electronically, particularly how databases can enhance data handling over manual methods.

Start chapter

Introduction to Structured Query Language (SQL)

This chapter introduces Structured Query Language (SQL) and its role in managing data within relational databases. It is essential for creating and manipulating databases effectively.

Start chapter

Worksheet Levels Explained

This drawer provides information about the different levels of worksheets available in the app.

Working with Lists and Dictionaries Summary, Important Questions & Solutions | All Subjects

Question Bank

Worksheet

Revision Guide