Computer Science - Object-Oriented Programming - Classes and objects - Writing Your First Class

Build a Student class step by step. Step 1 'Empty class': class Student: pass. That's a valid (but useless) class! s = Student() creates an object. Step 2 'Add __init__': class Student: def __init__(self, name, grade): self.name = name; self.grade = grade; self.scores = []. Explain self: it's the ob

Edodovivmagarwal
Computer Science - Object-Oriented Programming - Classes and objects - Writing Your First Class
Log in

Preparing your experience...

Loading scripts and resources

Comments (0)

0/5000

Comments are reviewed before appearing publicly.

About this Experience

Computer Science - Object-Oriented Programming - Classes and objects - Writing Your First Class

vivmagarwal
vivmagarwalJan 29, 2026

Description

Build a Student class step by step. Step 1 'Empty class': class Student: pass. That's a valid (but useless) class! s = Student() creates an object. Step 2 'Add __init__': class Student: def __init__(self, name, grade): self.name = name; self.grade = grade; self.scores = []. Explain self: it's the ob

Details

Computer ScienceObject-Oriented ProgrammingClass 9, Class 9, Stage 9, Grade 9

Engagement

10

Likes

0

Remixes

0

Comments