Defining A Class With Attributes
Mon 10 August 2026
class Person:
name = "Alice"
age = 25
p = Person()
print(p.name)
print(p.age)
Alice
25
Score: 10
Category: chapter1_oop_basics
class Person:
name = "Alice"
age = 25
p = Person()
print(p.name)
print(p.age)
Alice
25
Score: 10
Category: chapter1_oop_basics