benchmarks.wiki / Public workspace

BigCodeBench / BigCodeBench v0.1.0_hf d2975ce6-3d68-57d0-b9fe-ffdbe028b60e

Problem

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

complete prompt

from functools import reduce
import operator
import string

def task_func(letters):
    """
    Calculate the product of the corresponding numbers for a list of uppercase letters, 
    where \"A\" corresponds to 1, \"B\" to 2, etc.
    
    Parameters:
    letters (list of str): A list of uppercase letters.
    
    Returns:
    int: The product of the numbers corresponding to the input letters.
    
    Requirements:
    - functools.reduce
    - operator
    - string
    
    Examples:
    >>> task_func([\"A\", \"B\", \"C\"])
    6
    
    >>> task_func([\"A\", \"E\", \"I\"])
    45
    
    Note:
    The function uses a predefined dictionary to map each uppercase letter to its corresponding number.
    """

instruct prompt

Calculate the product of the corresponding numbers for a list of uppercase letters, where \"A\" corresponds to 1, \"B\" to 2, etc. >>> task_func([\"A\", \"E\", \"I\"]) 45
Note that: The function uses a predefined dictionary to map each uppercase letter to its corresponding number.
The function should output with:
    int: The product of the numbers corresponding to the input letters.
You should write self-contained code starting with:

Code

from functools import reduce
import operator
import string
def task_func(letters):

code prompt

Code

from functools import reduce
import operator
import string
def task_func(letters):

entry point

task_func

libs

  • operator
  • string
  • functools

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