BaşlayınÜcretsiz Başlayın

Using the @property decorator

Now that you've practiced working with a class that implements descriptors, you'll get to build your own using the @property decorator. Good luck!

Bu egzersiz

Intermediate Object-Oriented Programming in Python

kursunun bir parçasıdır
Kursu Görüntüle

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

class BankAccount:
  def __init__(self, email):
    self.email = email
  
  # Define and decorate a method to begin the process of 
  # creating a descriptor for the email attribute
  @____
  def ____(self):
    return f"Email for this account is: {____.____}"
Kodu Düzenle ve Çalıştır