MulaiMulai sekarang secara gratis

Create your first class

Time to write your first class!

In this exercise, you'll start building the Employee class, beginning by defining it as an empty class, and then adding a method allowing you to set an object's .name attribute.

Latihan ini adalah bagian dari kursus

Introduction to Object-Oriented Programming in Python

Lihat Kursus

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.

# Create an empty class Employee
____


# Create an object emp of class Employee 
____
Edit dan Jalankan Kode