c7964d00-9a29-4095-9973-8b9b2d598fdb
prompter
Given the following Python function, can you please rewrite it in a more pythonic form?

def double_numbers(numbers):
    doubled = []
    for number in numbers:
        doubled.append(number * 2)
    return doubled
2a81d3ca-b5c4-4820-a607-55eb520c8bc8
c7964d00-9a29-4095-9973-8b9b2d598fdb
assistant
Sure. I've added indentation, documentation, used list comprehension, and used typing libraries:

```
from typing import List
from numbers import Number


def double_numbers(numbers: List[Number]):
    """Get a list where each element is double the value in the input list."""
    return [n * 2 for n in numbers]

```
2b8de34e-8551-46b6-9776-d99959e53f3c
2a81d3ca-b5c4-4820-a607-55eb520c8bc8
prompter
Please remove the `typing` and `numbers` imports
0334e1ce-56fd-48ad-842f-645cb9031229
2b8de34e-8551-46b6-9776-d99959e53f3c
assistant
Sure! Here is the same code, without the `typing` and `numbers` imports:

```python
def double_numbers(numbers: List[Number]):
    """Get a list where each element is double the value in the input list."""
    return [n * 2 for n in numbers]
```