---
id: 68e529226b0defdff26c4a8a
title: Step 6
challengeType: 20
dashedName: step-6
---

# --description--

Now, create an instance of `Product` with the name `Wireless Mouse` and a price of `50.0`. Assign it to a variable named `product`. Then, print `product` to the console to see what it looks like.

# --hints--

You should have a variable named `product`.

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

You should assign an instance of `Product` to the `product` variable.

```js
({
  test: () => runPython(`assert isinstance(product, Product)`)
})
```

Your `Product` instance should have the name `Wireless Mouse` and price `50.0`.

```js
({
  test: () => runPython(`
    assert product.name == 'Wireless Mouse'
    assert product.price == 50.0
  `)
})
```

You should print `product` to the console.

```js
({
  test: () => runPython(`assert _Node(_code).has_call("print(product)")`)
})
```

When you print a `Product` with name `'Wireless Mouse'` and price `50.0`, it should display `Wireless Mouse - $50.0`.

```js
({
  test: () => runPython(`
    import io
    import sys
    captured_output = io.StringIO()
    sys.stdout = captured_output

    test_product = Product('Wireless Mouse', 50.0)
    print(test_product)

    sys.stdout = sys.__stdout__
    output = captured_output.getvalue()

    assert "Wireless Mouse - $50.0" in output
  `)
})
```

# --seed--

## --seed-contents--

```py
class Product:
    def __init__(self, name: str, price: float) -> None:
        self.name = name
        self.price = price

    def __str__(self) -> str:
        return f'{self.name} - ${self.price}'
--fcc-editable-region--

--fcc-editable-region--
```
