benchmarks.wiki / Public workspace

BigCodeBench / BigCodeBench v0.1.0_hf 31d32689-dcc3-58ed-b55b-feb51a6bdf21

Problem

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

complete prompt

from collections import deque
import math

def task_func(l):
    """
    Create a deque from a list, rotate it to the right by 3 positions, and return the deque.
    Also, for demonstration, calculates the square root of the sum of numeric elements in the deque,
    if there are any, and prints it.

    Parameters:
    - l (list): A list of elements to be converted into a deque and rotated.

    Returns:
    - dq (collections.deque): A deque obtained from the input list after performing a right rotation by 3 positions.

    Requirements:
    - collections
    - math

    Example:
    >>> task_func(['A', 'B', 'C', 'D', 'E'])
    deque(['C', 'D', 'E', 'A', 'B'])

    >>> task_func([1, 2, 3, 4, 5])
    The square root of the sum of numeric elements: 3.872983346207417
    deque([3, 4, 5, 1, 2])
    """

instruct prompt

Create a deque from a list, rotate it to the right by 3 positions, and return the deque. Also, for demonstration, calculates the square root of the sum of numeric elements in the deque, if there are any, and prints it. >>> task_func([1, 2, 3, 4, 5]) The square root of the sum of numeric elements: 3.872983346207417 deque([3, 4, 5, 1, 2])
The function should output with:
    dq (collections.deque): A deque obtained from the input list after performing a right rotation by 3 positions.
You should write self-contained code starting with:

Code

from collections import deque
import math
def task_func(l):

code prompt

Code

from collections import deque
import math
def task_func(l):

entry point

task_func

libs

  • math
  • collections

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