Write a property
Level: Beginner (score: 2)
Write a simple Promo
class. Its constructor receives two variables: name
(which must be a string) and expires
(which must be a datetime
object).
Add a property
called expired
which returns a boolean value indicating whether the promo has expired or not.
Checkout the tests and datetime
module for more info. Have fun!