DEV Community

SEAN
SEAN

Posted on

Day 4: Class v Instance

Konnichiwa!

Welcome to day 4! Python is an object orientated programming language (OOP) and this was the first introduction to one of the core ideas of OOP. The object of this task was to create a class. A class is kind of like a blueprint for a car. It contains all details about the amount of wheels, engine type, windows etc. based on this data we can construct the car. The car is the object.

This task asked us to create a Person class with an instance variable(age), then to work out if the person was young or old depending on the age given. I felt it hit close to home as i don’t consider myself old, but apparently anything over 18 is!

Heres my code:

Alt Text

Top comments (0)