---
id: 68e529226b0defdff26c4a89
title: Step 3
challengeType: 20
dashedName: step-3
---

# --description--

Right now, if you create an instance of `Product` and print it, you'll see a default object representation that isn't very informative. For example, it might look something like `<__main__.Product object at 0x7f9b8c2d1d30>`.

To convert the default object representation into a readable string, create a `__str__` method in your `Product` class that returns a string with the format `name - $price` (where `name` and `price` should be replaced with the values of the corresponding attributes).

# --hints--

Your `Product` class should have a `__str__` method.

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

Your `__str__` method should return a string in the format `name - $price`.

```js
({
  test: () => runPython(`
    test_product = Product("Test Item", 25.5)
    assert str(test_product) == "Test Item - $25.5"
  `)
})
```

# --seed--

## --seed-contents--

```py
class Product:
    def __init__(self, name: str, price: float):
        self.name = name
        self.price = price
--fcc-editable-region--
    
--fcc-editable-region--
```
