Create your first class
Time to write your first class! In this exercise, you'll start building the Employee
class you briefly explored in the previous lesson. You'll start by creating methods that set attributes, and then add a few methods that manipulate them.
As mentioned in the first video, an object-oriented approach is most useful when your code involves complex interactions of many objects. In real production code, classes can have dozens of attributes and methods with complicated logic, but the underlying structure is the same as with the most simple class.
Your classes in this course will only have a few attributes and short methods, but the organizational principles behind the them will be directly translatable to more complicated code.
This exercise is part of the course
Object-Oriented Programming in Python
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Create an empty class Employee
___
# Create an object emp of class Employee
___