Matric exams start 16 Mar 2027 · 116 days left Notes →

Class 10 Computer · Chapter 3

Class 10 Computer Chapter 3 Notes – Introduction to Python Programming (New Syllabus 2026-27)

Free 10th class computer chapter 3 notes for Introduction to Python Programming, written for the new 2026-27 Punjab Board syllabus. You get key definitions, short runnable Python examples and clear explanations of variables, data types, input, output and operators. Read the overview below or download the full notes as a free PDF.

  • New syllabus 2026-27
  • Punjab Boards
  • 4 free PDFs · no sign-up
  • Updated · checked by Sir Bilal, MCS

Free PDFs

All Chapter 3 downloads

Every PDF for Chapter 3: notes, short questions, MCQs and exercise solutions. Free to read online or download, no sign-up.

Overview

What Chapter 3 Introduction to Python Programming is about

Class 10 Computer Chapter 3 Notes – Introduction to Python Programming

Chapter 3 is your first step into programming with Python, a simple and popular language used for websites, data science and artificial intelligence. You will learn how to write and run a program, store values in variables, and use the main data types: integers, floats, strings and booleans. The chapter shows how to show output with print(), take input from the user with input(), convert between types, and do calculations with arithmetic, comparison and logical operators. Small programs like a marks percentage calculator or a shopping bill in rupees make each idea practical.

Chapter 3 Introduction to Python Programming at a glance: python and its features, comments and syntax, variables, data types, input and output, and operators3.1Python and its featuresSimple, free, interpreted3.2Comments and syntaxIndentation and # comments3.3VariablesNamed boxes that hold values3.4Data typesint, float, str, bool3.5Input and outputinput() reads, print() shows3.6OperatorsArithmetic, comparison, logic
Chapter 3 at a glance: the six topics in the order the notes teach them, with the one idea or formula to remember for each.

Topics covered in the notes

  • 3.1 Python and its features: features of Python, IDLE, script vs interactive mode.
  • 3.2 Comments and syntax: comments, keywords, indentation, case sensitivity.
  • 3.3 Variables: naming rules, assignment, multiple assignment.
  • 3.4 Data types: int, float, str, bool, type() and type conversion.
  • 3.5 Input and output: print() with sep and end, input() returns a string.
  • 3.6 Operators: arithmetic, assignment, comparison, logical operators, precedence.

Key terms

  • Variable is a name that refers to a value stored in memory, for example age = 15.
  • Data type is the kind of value a variable holds, such as int (whole number), float (decimal), str (text) or bool (True/False).
  • Comment is a note in the code that Python ignores; a single-line comment starts with the # symbol.
  • Interpreter is a program that translates and runs Python code one line at a time, stopping at the first error.
  • Type casting is converting a value from one data type to another, for example int("25") gives 25.
  • Operator precedence is the order in which Python evaluates operators: brackets first, then **, then * / // %, then + and -.

Code examples

Variables and data types
name = "Ali"        # str
age = 15            # int
height = 5.4        # float
is_student = True   # bool
print(name, age, height, is_student)
print(type(age), type(height))
Taking input and converting types
name = input("Enter your name: ")
marks = int(input("Enter marks out of 100: "))
print("Hello", name)
print("Marks with 5 bonus:", marks + 5)
Arithmetic operators
a = 17
b = 5
print("a + b =", a + b)    # 22
print("a / b =", a / b)    # 3.4
print("a // b =", a // b)  # 3 (floor division)
print("a % b =", a % b)    # 2 (remainder)
print("a ** 2 =", a ** 2)  # 289 (power)
Shopping bill with comparison and logic
price = 250      # rupees per item
quantity = 3
total = price * quantity
print("Total bill: Rs", total)
print("Over Rs 500?", total > 500)
print("Between 500 and 1000?", total >= 500 and total <= 1000)

Questions students ask

Why does input() need int() for numbers?

input() always returns text (a string). If you type 50, Python stores "50", so you must convert it with int() or float() before doing maths with it.

What is the difference between / and // in Python?

The / operator always gives a decimal result (17 / 5 = 3.4). The // operator gives floor division, dropping the decimal part (17 // 5 = 3).

What is the difference between = and == in Python?

A single = assigns a value to a variable (x = 10). A double == compares two values and gives True or False (x == 10).

Can I run these Python examples on my phone?

Yes. You can use a free Python app or an online Python editor in your browser. On a computer, install Python from python.org and use IDLE.