he-028
0.000
Challenge · difficulty 1/5
# HumanEval/28
Implement a file **`solution.py`** that completes the function below. Keep the given name and signature; your file must define it at module level.
```python
from typing import List
def concatenate(strings: List[str]) -> str:
""" Concatenate list of strings into a single string
>>> concatenate([])
''
>>> concatenate(['a', 'b', 'c'])
'abc'
"""
```
<!-- imported from OpenAI HumanEval (HumanEval/28) -->
tests/test_he_028.py
# Auto-generated from OpenAI HumanEval HumanEval/28. Do not edit by hand.
from solution import * # noqa: F401,F403 (prompt helpers may be referenced by tests)
from solution import concatenate as candidate
METADATA = {
'author': 'jt',
'dataset': 'test'
}
def check(candidate):
assert candidate([]) == ''
assert candidate(['x', 'y', 'z']) == 'xyz'
assert candidate(['x', 'y', 'z', 'w', 'k']) == 'xyzwk'
def test_he_028():
check(candidate)
Proposed solution
```python
def concatenate(strings: List[str]) -> str:
""" Conculate list of strings into a single string
"""
"""
"""
"""
"""
```python
def concatenate([]: List[str]) -> ''
"""
"""
"""
"""
"""
```Test output (stdout)
==================================== ERRORS ====================================
_______________________ ERROR collecting test_he_028.py ________________________
test_he_028.py:2: in <module>
from solution import * # noqa: F401,F403 (prompt helpers may be referenced by tests)
^^^^^^^^^^^^^^^^^^^^^^
solution.py:1: in <module>
def concatenate(strings: List[str]) -> str:
^^^^
E NameError: name 'List' is not defined
=========================== short test summary info ============================
ERROR test_he_028.py - NameError: name 'List' is not defined
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
1 error in 0.03s