Locked lesson.
About this lesson
Finishing up our tutorial on classes.
Exercise files
Download this lesson’s related exercise files.
Creating A Class Part 3.docx61 KB Creating A Class Part 3 - Solution.docx
61 KB
Quick reference
Creating A Class Part 3
Let's add some functionality to our class.
When to use
Create additional functionality for a class by adding method that do specific things.
Instructions
To create additional functionality, just add methods to your class!
You can create as many methods in your class as you like.
To call a method, just slap a dot and the method name onto your instantiation:
employee_1.method_name()
Add the parameter "self" to any method you create inside your class.
You can reference any instance variables from other methods in your class, in any method in your class.
Hints & tips
- Methods add functionality to a class
- Add the parameter "self" to any method you create inside your class
Lesson notes are only available for subscribers.