← Course overview

AI Engineering 843

CBSE AI 843 · Python OOP, stats & end-to-end ML · 13 chapters

Sign up to save XP
0% complete

Mapped to CBSE AI subject code 843 — Class 11 syllabus.

Chapter 1 of 13 16 min

Python OOP & classes

Story

Aanya and Vihaan reach a new challenge: "Python OOP & classes". Think about student class.

Pixel beeps: "Don't just read about it — let's learn by DOING. Try the demo below! "

The idea

Objects model the world. Object-Oriented Programming groups data and behaviour into classes. A Student class holds name and marks (data) plus a study() method (behaviour).

Blueprints & instances. A class is a blueprint; each object you create from it is an instance. One Student class can create thousands of student objects.

Indian-life example — Student class

class Student: def __init__(self, name, marks): self.name=name; self.marks=marks — create many students from one blueprint.

Interactive demo — do it yourself
Pixel · Step 1 of 4

Tap a Mango, then tap the Mango box.

Mango (0)
Orange (0)
Practice — your turn

A class is a…

try.py
Python sandbox
Terminal
› Click Run to execute. First run loads Python (~6s).
Recap
  • Objects model the world
  • Blueprints & instances
+15 XP on complete

Finish the demo and practice above to continue.