Write a programming task in the following format: "Title": "[Task…
- User
Assistant: User: Write a programming task in the following format:
"Title": "[Task title]", "Task Description": "[Brief description of the task, what needs to be done]", "Function Signature": "def function name -> [return type]:"
Please make sure to only provide the title, task description, and function signature, without examples, constraints, or detailed explanations.
Also, provide a solution for the task in Python code in the following format:
"Solve": "```python [Solution to the task in Python]
For example: "Title": "Convert Fahrenheit to Celsius", "Task Description": "Write a function that converts a given temperature from Fahrenheit to Celsius.", "Function Signature": "def fahrenheit_to_celsius(fahrenheit: float) -> float:", "Solve": "```python def fahrenheit_to_celsius(fahrenheit: float) -> float: return (fahrenheit - 32) * 5 / 9 ```" Please follow this format exactly, without any additional explanations or comments. Assistant: - Assistant
"Title": "Sum of All Even Numbers in a List", "Task Description": "Write a function that calculates the sum of all even numbers in a given list of integers.", "Function Signature": "def sum_of_evens(numbers: list) -> int:", "Solve": "```python def sum_of_evens(numbers: list) -> int: return sum(num for num in numbers if num % 2 == 0)
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.