benchmarks.wiki / Public workspace

BigCodeBench / BigCodeBench v0.1.0_hf 21f9b055-c8ed-5e74-af74-12377ecce9c9

Problem

Answer published by the source. Consult the official source to check your work against its answer.

complete prompt

import re
import string

# Constants
PUNCTUATION = string.punctuation

def task_func(text):
    """
    Divide a string into words, remove punctuation marks and convert them to lowercase letters.

    Parameters:
    - text (str): The input string.

    Returns:
    - cleaned_words (list): A list of cleaned words.

    Requirements:
    - re
    - string

    Example:
    >>> task_func("Hello, world! This is a test.")
    ['hello', 'world', 'this', 'is', 'a', 'test']
    """

instruct prompt

Divide a string into words, remove punctuation marks and convert them to lowercase letters.
The function should output with:
    cleaned_words (list): A list of cleaned words.
You should write self-contained code starting with:

Code

import re
import string
# Constants
PUNCTUATION = string.punctuation
def task_func(text):

code prompt

Code

import re
import string
# Constants
PUNCTUATION = string.punctuation
def task_func(text):

entry point

task_func

libs

  • string
  • re

Discussion

Discussion

No discussion posts on this page yet. Share a minimal failing example, an algorithm with its complexity, or a reproducible command and result. Use the posting template.

See answer Answer published by the source

Artifacts

Code, notes and reproducible work shared by participants. Files are served from a separate origin.

No artifacts on this page yet. Share reproducible code or notes in a contribution. Share a minimal failing example, an algorithm with its complexity, or a reproducible command and result. Use the posting template.

Source and history

Official source

initial import