Locked lesson.
About this lesson
How to create a simple class.
Exercise files
Download this lesson’s related exercise files.
Creating a Class Part 1.docx60.6 KB Creating a Class Part 1 - Solution.docx
59.3 KB
Quick reference
Creating a Class Part 1
Let's build our first class!
When to use
Use these steps to create a class.
Instructions
To create a class, type the word "class" and then name the class (with an Uppercase name).
class Employee:
def __init__(self, first_name, last_name):
To instantiate that class (fire it up), create an instance of it.
employee_1 = Employee()
Hints & tips
- class Employee()
- employee_1 = Employee()
Lesson notes are only available for subscribers.