benchmarks.wiki / Public workspace

BigCodeBench / BigCodeBench v0.1.0_hf 071c0e46-0174-55d7-8d4e-d9e2cd41a7db

Problem

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

complete prompt

import math
from sympy import isprime


def task_func(input_list):
    """
    Filter the prime numbers from the specified list, sort the prime numbers 
    ascending based on their radian value converted to degrees, and return the sorted list.
    
    The function uses the isprime function from the sympy library to determine prime numbers 
    and the degrees function from the math library to sort the numbers based on their degree value.

    Parameters:
    input_list (list[int]): A list of integers to be filtered and sorted.

    Returns:
    list[int]: A sorted list of prime numbers based on their degree value.

    Requirements:
    - math
    - sympy

    Examples:
    >>> task_func([4, 5, 2, 7, 89, 90])
    [2, 5, 7, 89]
    
    >>> task_func([101, 102, 103, 104])
    [101, 103]
    """

instruct prompt

Filter the prime numbers from the specified list, sort the prime numbers ascending based on their radian value converted to degrees, and return the sorted list. The function uses the isprime function from the sympy library to determine prime numbers and the degrees function from the math library to sort the numbers based on their degree value. >>> task_func([101, 102, 103, 104]) [101, 103]
The function should output with:
    list[int]: A sorted list of prime numbers based on their degree value.
You should write self-contained code starting with:

Code

import math
from sympy import isprime
def task_func(input_list):

code prompt

Code

import math
from sympy import isprime
def task_func(input_list):

entry point

task_func

libs

  • math
  • sympy

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