---
id: 68af277e60e009597dd861e9
title: Step 9
challengeType: 20
dashedName: step-9
---

# --description--

Now create a new class named `MediaCatalogue`, and give it an `__init__` method that sets an `items` attribute to an empty list. This will represent the list of items in the catalogue. 

# --hints--

You should have a class named `MediaCatalogue`.

```js
({
  test: () => runPython(`assert _Node(_code).has_class("MediaCatalogue")`)
})
```

Your `MediaCatalogue` class should have an `__init__` method.

```js
({
    test: () => runPython(`
    assert _Node(_code).find_class("MediaCatalogue").has_function("__init__")
    `)
})
```

Your `__init__` method should set the `items` attribute to an empty list.

```js
({
    test: () => runPython(`
    _catalogue = MediaCatalogue()
    assert _catalogue.items == []
    `)
})
```

# --seed--

## --seed-contents--

```py
class Movie:
    def __init__(self, title, year, director, duration):
        if not title.strip():
            raise ValueError('Title cannot be empty')
        if year < 1895:
            raise ValueError('Year must be 1895 or later')
        if not director.strip():
            raise ValueError('Director cannot be empty')
        if duration <= 0:
            raise ValueError('Duration must be positive')
        self.title = title
        self.year = year
        self.director = director
        self.duration = duration

    def __str__(self):
        return f'{self.title} ({self.year}) - {self.duration} min, {self.director}'
--fcc-editable-region--

--fcc-editable-region--
try:
    movie1 = Movie('The Matrix', 1999, 'The Wachowskis', 136)
except ValueError as e:
    print(f'Validation Error: {e}')
```
