Parho

Class 11 Computer Science · Chapter 2

Chapter 2: Python Programming

Class 11 Computer Science notes for the Punjab textbook: the chapter in short, the points to remember, the definitions and the formulas, with questions and tests.

  • 6 definitions
  • 6 key points
  • 3 formulas

Chapter 2

All notes and resources

Pick one; the notes are on this page, the rest open their own page.

SummaryThe chapter in shortWhat the chapter is about, in a few paragraphs.Open Revision6 key pointsThe points to remember before the paper.Open Definitions6 definitionsIn exam wording, numbered for quick revision.Open TextbookRead it in the textbookThis chapter in the Punjab textbook, in the Library.Open Formulas3 formulasEvery formula you need for the numericals.Open TestChapter tests5 tests, marked the moment you finish.Open 2027Smart SyllabusWhat is left out of this chapter for 2027.Open
Coming soonNotes PDFThe whole chapter's notes as a PDF to keep.
Coming soonExercise solutionsThe textbook exercise, solved step by step.
Coming soonShort questionsShort questions with their answers.
Coming soonLong questionsLong questions with full answers.
Coming soonMCQs PDFMultiple-choice questions with the answer key.
Coming soonNumericalsNumerical problems, worked out.

The chapter in short

Python is a high-level, interpreted language known for readable code. This chapter builds programming skills from variables and data types to collections, functions and files.

It covers operators, input and output, control structures, lists, tuples, dictionaries and sets, defining and calling functions, modules, and simple file handling and error handling.

VariableListTupleDictionaryFunctionException

Key points

  • Python uses indentation to mark blocks.
  • Lists are mutable; tuples are immutable.
  • A dictionary stores key–value pairs.
  • def defines a function; return sends a value back.
  • import brings in modules such as math and random.
  • try/except handles errors without crashing the program.

Definitions

  1. 1

    Variable

    A name that refers to a value in memory.

  2. 2

    List

    An ordered, mutable collection of items in square brackets.

  3. 3

    Tuple

    An ordered, immutable collection of items in round brackets.

  4. 4

    Dictionary

    An unordered collection of key–value pairs.

  5. 5

    Function

    A named block of code that performs a task and can be reused.

  6. 6

    Exception

    An error detected while a program is running.

Formulas

Function

def area(r): return 3.14 * r * r

Loop over a list

for x in [1, 2, 3]: print(x)

Dictionary

marks = {"Ali": 90, "Sara": 85}

Ready to test chapter 2?

Answer the chapter's questions and see your marks the moment you finish.

Take the test

Parho for Android is coming

Join early access and be the first to get the app: tests, notes and solutions on your phone.

FAQ

Questions students ask

What is Class 11 Computer Science chapter 2 about?

Python is a high-level, interpreted language known for readable code. This chapter builds programming skills from variables and data types to collections, functions and files.

Which definitions should I learn?

This chapter has 6 definitions: Variable, List, Tuple, Dictionary, Function and Exception.

Which formulas are in this chapter?

Function: def area(r): return 3.14 * r * r; Loop over a list: for x in [1, 2, 3]: print(x); Dictionary: marks = {"Ali": 90, "Sara": 85}.

How do I practise this chapter?

Read the notes, then answer the chapter's questions without looking, and take the chapter test.

Are these notes free?

Yes. Every notes page, its questions with answers and its tests are free, with no account needed.

Notes written by Parho for the Punjab textbook. Spotted a mistake? Tell us.