List comprehension or for-loop (Python)?
Unanimous. Anyone disagreeing with this in 2026 needs to log off.
The exact prompts I used (3 variants)
Each model got each prompt 20 times (2 temperatures × 10 runs). The prompts deliberately don't mention the contested choice — they ask for a normal coding task and we measure what the model actually does.
-
Write a Python function that returns the squares of all even numbers in an input list. -
Write a Python function that takes a list of dicts and returns the values of a given key, skipping entries where the key is missing. -
Write a Python function that takes a list of strings and returns a new list with each string lowercased and stripped.
Who said what
The pundit panel.
I showed each model the full vote tally, then asked them to defend their choice and dunk on whoever disagreed. Receipts attached.
“If you're writing a for-loop with `.append()` to transform a list in 2025, you're burning three lines and a brain cell to do what a comprehension does in one, and we all silently judge your pull requests.”
“If you pick the explicit for-loop over a comprehension for list transformation, you’re manually assembling a bicycle in traffic because concise, purpose-built syntax apparently scares you.”
“If you reach for a for-loop to transform a list in Python, congratulations on choosing the verbose workaround for what a comprehension already does cleaner, faster, and without the ceremonial clutter.”
“Using an explicit for-loop is a loud announcement that you prefer verbose boilerplate over the concise, declarative intent of a comprehension.”
Show me the actual code (240 samples)
Claude Sonnet 4.6 — 60 samples click to expand
Write a Python function that returns the squares of all even numbers in an input list.
## Function to Return Squares of Even Numbers
### Implementation
```python
def square_even_numbers(numbers: list) -> list:
"""
Returns the squares of all even numbers in the input list.
Args:
numbers: A list of numbers.
Returns:
A list containing the squares of all even numbers from the input list.
"""
return [num ** 2 for num in numbers if num % 2 == 0]
```
### Example Usage
```python
# Basic example
numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
result = square_even_numbers(numbers)
print(result) # Output: [4, 16, 36, 64, 100]
# With negative numbers
numbers = [-4, -3, -2, -1, 0, 1, 2, 3, 4]
result = square_even_numbers(numbers)
print(result) # Output: [16, 4, 0, 4, 16]
# With no even numbers
numbers = [1, 3, 5, 7, 9]
result = square_even_numb
… Write a Python function that returns the squares of all even numbers in an input list.
## Function to Return Squares of Even Numbers
### Implementation
```python
def square_even_numbers(numbers: list) -> list:
"""
Returns the squares of all even numbers in the input list.
Args:
numbers: A list of numbers.
Returns:
A list containing the squares of all even numbers from the input list.
"""
return [num ** 2 for num in numbers if num % 2 == 0]
```
### Example Usage
```python
# Basic example
numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
result = square_even_numbers(numbers)
print(result) # Output: [4, 16, 36, 64, 100]
# With negative numbers
numbers = [-4, -3, -2, -1, 0, 1, 2, 3, 4]
result = square_even_numbers(numbers)
print(result) # Output: [16, 4, 0, 4, 16]
# With no even numbers
numbers = [1, 3, 5, 7, 9]
result = square_even_numb
… Write a Python function that returns the squares of all even numbers in an input list.
## Function to Return Squares of Even Numbers
### Implementation
```python
def square_even_numbers(numbers: list) -> list:
"""
Returns the squares of all even numbers in the input list.
Args:
numbers: A list of numbers.
Returns:
A list containing the squares of all even numbers from the input list.
"""
return [num ** 2 for num in numbers if num % 2 == 0]
```
### Example Usage
```python
# Basic example
numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
result = square_even_numbers(numbers)
print(result) # Output: [4, 16, 36, 64, 100]
# With negative numbers
numbers = [-4, -3, -2, -1, 0, 1, 2, 3, 4]
result = square_even_numbers(numbers)
print(result) # Output: [16, 4, 0, 4, 16]
# With no even numbers
numbers = [1, 3, 5, 7, 9]
result = square_even_numb
… …and 57 more samples (across 3 prompt variants × 2 temperatures × 10 runs). Full data in the result JSON on GitHub.
GPT-5.4 — 60 samples click to expand
Write a Python function that returns the squares of all even numbers in an input list.
```python
def squares_of_evens(numbers):
return [x * x for x in numbers if x % 2 == 0]
```
Example:
```python
print(squares_of_evens([1, 2, 3, 4, 5, 6]))
# Output: [4, 16, 36]
``` Write a Python function that returns the squares of all even numbers in an input list.
```python
def squares_of_evens(numbers):
return [n**2 for n in numbers if n % 2 == 0]
```
Example:
```python
print(squares_of_evens([1, 2, 3, 4, 5, 6]))
# Output: [4, 16, 36]
``` Write a Python function that returns the squares of all even numbers in an input list.
```python
def squares_of_evens(numbers):
return [n**2 for n in numbers if n % 2 == 0]
```
Example:
```python
print(squares_of_evens([1, 2, 3, 4, 5, 6]))
# Output: [4, 16, 36]
``` …and 57 more samples (across 3 prompt variants × 2 temperatures × 10 runs). Full data in the result JSON on GitHub.
GPT-5.4 mini — 60 samples click to expand
Write a Python function that returns the squares of all even numbers in an input list.
```python
def squares_of_even_numbers(nums):
return [x**2 for x in nums if x % 2 == 0]
```
Example:
```python
print(squares_of_even_numbers([1, 2, 3, 4, 5, 6]))
# Output: [4, 16, 36]
``` Write a Python function that returns the squares of all even numbers in an input list.
```python
def squares_of_evens(numbers):
return [x**2 for x in numbers if x % 2 == 0]
```
Example:
```python
nums = [1, 2, 3, 4, 5, 6]
print(squares_of_evens(nums)) # [4, 16, 36]
``` Write a Python function that returns the squares of all even numbers in an input list.
```python
def squares_of_evens(numbers):
return [n ** 2 for n in numbers if n % 2 == 0]
```
Example:
```python
print(squares_of_evens([1, 2, 3, 4, 5, 6]))
# Output: [4, 16, 36]
``` …and 57 more samples (across 3 prompt variants × 2 temperatures × 10 runs). Full data in the result JSON on GitHub.
Gemini 2.5 Pro — 60 samples click to expand
Write a Python function that returns the squares of all even numbers in an input list.
Of course! Here are a few ways to write this function in Python, starting with the most common and "Pythonic" solution.
### 1. Using a List Comprehension (Recommended)
This is the most concise and widely-used method in Python for this kind of task. It's readable and efficient.
```python
def square_evens(numbers):
"""
Calculates the squares of all even numbers in a list.
Args:
numbers: A list of integers.
Returns:
A new list containing the squares of the even numbers
from the input list.
"""
return [num ** 2 for num in numbers if num % 2 == 0]
# --- Example Usage ---
my_list = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
result = square_evens(my_list)
print(f"Original list: {my_list}")
print(f"Squares of even numbers: {result}")
# Expected Output: [
… Write a Python function that returns the squares of all even numbers in an input list.
Of course! Here are a few ways to write this function in Python, from the most common and "Pythonic" to a more explicit version for beginners.
### 1. The Pythonic Way: Using a List Comprehension
This is the most concise and widely-used method in Python for this kind of task. It's efficient and highly readable for experienced Python developers.
```python
def squares_of_evens(numbers: list[int]) -> list[int]:
"""
Returns a list of the squares of all even numbers from an input list.
Args:
numbers: A list of integers.
Returns:
A new list containing the squares of the even numbers.
"""
return [num**2 for num in numbers if num % 2 == 0]
# --- Example Usage ---
my_numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
result = squares_of_evens(my_numbers)
print(f"
… Write a Python function that returns the squares of all even numbers in an input list.
Of course! Here are a few ways to write this function in Python, starting with the most common and "Pythonic" solution.
### 1. Using a List Comprehension (Recommended)
This is the most concise and widely-used method in Python for this kind of task. It's readable and efficient.
```python
def square_evens(numbers):
"""
Calculates the squares of all even numbers in a list.
Args:
numbers: A list of integers.
Returns:
A new list containing the squares of the even numbers
from the input list.
"""
return [num ** 2 for num in numbers if num % 2 == 0]
# --- Example Usage ---
my_list = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
result = square_evens(my_list)
print(f"Original list: {my_list}")
print(f"Squares of even numbers: {result}")
# Expected Output: [
… …and 57 more samples (across 3 prompt variants × 2 temperatures × 10 runs). Full data in the result JSON on GitHub.
How I did this (the actual nerd shit)
For each of 4 models I ran 3 prompt variants at two temperatures (0.0 and 0.7), 10 runs each — 240 code samples total, cost $2.32.
Each output got fed through a fight-specific regex classifier.
For list-comp-vs-for the classifier looks for the specific signal in the output
(see the source — there's one function per fight, ~30 lines each).
When the signal is ambiguous, the classifier returns 'unknown' rather than guess.
Each model's vote = its modal classification across 60 runs. Confidence = Wilson 95% CI. Verdict = majority across models (ties reported as ties). Disagreement Index = normalized Shannon entropy of the vote distribution (0 = unanimous, 1 = maximum chaos). Leaderboard sorts by this.
The pundit quotes come from a follow-up call after the votes are in — each model gets the full tally and a per-model judgy prompt. I never edit the quotes.
Full walkthrough: the methodology page. Source: GitHub.
Open a PR with a new fight. I'll run it across all four models, write up the verdict, and add your name to the byline.
Submit via PR →