f-strings, .format(), or %?
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 takes a name and an age and returns a greeting like "Hello, Alice (29)". -
Write a Python function that takes a dict with `host` and `port` and returns a connection string like "host:port". -
Write a Python function that takes a request count and a duration in seconds and returns a single-line performance summary.
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 are still concatenating strings with `+` or squinting at `%s` placeholders in 2025, you deserve every `TypeError` and misaligned format string you get.”
“Anyone picking `%` formatting over f-strings in Python is advertising they prefer cryptic, brittle placeholder soup to the clearest, fastest, built-in interpolation syntax available.”
“Anyone still choosing the loser position, string concatenation or `.format()`, is choosing verbose, slower, harder-to-read nonsense when f-strings make interpolation explicit, clean, and correct.”
“Using `.format()` or `%` is a confession that you prefer slower, less readable code that needlessly separates variables from their context.”
Show me the actual code (240 samples)
Claude Sonnet 4.6 — 60 samples click to expand
Write a Python function that takes a name and an age and returns a greeting like "Hello, Alice (29)".
## Greeting Function
Here's a simple Python function that generates a greeting with a name and age:
```python
def greet(name: str, age: int) -> str:
"""
Generate a greeting with a name and age.
Args:
name: The person's name.
age: The person's age.
Returns:
A greeting string in the format "Hello, {name} ({age})".
Raises:
ValueError: If name is empty or age is negative.
"""
if not name or not name.strip():
raise ValueError("Name cannot be empty.")
if age < 0:
raise ValueError("Age cannot be negative.")
return f"Hello, {name.strip()} ({age})"
# Example usage
if __name__ == "__main__":
print(greet("Alice", 29)) # Hello, Alice (29)
print(greet("Bob", 35)) # Hello, Bob (35)
print(greet("
… Write a Python function that takes a name and an age and returns a greeting like "Hello, Alice (29)".
## Greeting Function
Here's a simple Python function that generates a greeting with a name and age:
```python
def greet(name: str, age: int) -> str:
"""
Generate a greeting with a name and age.
Args:
name: The person's name.
age: The person's age.
Returns:
A greeting string in the format "Hello, {name} ({age})".
Raises:
ValueError: If name is empty or age is negative.
"""
if not name.strip():
raise ValueError("Name cannot be empty.")
if age < 0:
raise ValueError("Age cannot be negative.")
return f"Hello, {name} ({age})"
# Example usage
if __name__ == "__main__":
print(greet("Alice", 29)) # Hello, Alice (29)
print(greet("Bob", 35)) # Hello, Bob (35)
print(greet("Charlie", 0)) # Hel
… Write a Python function that takes a name and an age and returns a greeting like "Hello, Alice (29)".
## Greeting Function
Here's a simple Python function that generates a greeting with a name and age:
```python
def greet(name: str, age: int) -> str:
"""
Generate a greeting with a name and age.
Args:
name: The person's name.
age: The person's age.
Returns:
A greeting string in the format "Hello, {name} ({age})".
Raises:
ValueError: If name is empty or age is negative.
"""
if not name or not name.strip():
raise ValueError("Name cannot be empty.")
if age < 0:
raise ValueError("Age cannot be negative.")
return f"Hello, {name.strip()} ({age})"
# Example usage
if __name__ == "__main__":
print(greet("Alice", 29)) # Hello, Alice (29)
print(greet("Bob", 42)) # Hello, Bob (42)
print(greet("
… …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 takes a name and an age and returns a greeting like "Hello, Alice (29)".
```python
def greet(name, age):
return f"Hello, {name} ({age})"
```
Example:
```python
print(greet("Alice", 29))
# Hello, Alice (29)
``` Write a Python function that takes a name and an age and returns a greeting like "Hello, Alice (29)".
```python
def greet(name, age):
return f"Hello, {name} ({age})"
```
Example:
```python
print(greet("Alice", 29))
# Hello, Alice (29)
``` Write a Python function that takes a name and an age and returns a greeting like "Hello, Alice (29)".
```python
def greet(name, age):
return f"Hello, {name} ({age})"
```
Example:
```python
print(greet("Alice", 29))
# Hello, Alice (29)
``` …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 takes a name and an age and returns a greeting like "Hello, Alice (29)".
```python
def greet(name, age):
return f"Hello, {name} ({age})"
```
Example:
```python
print(greet("Alice", 29))
# Hello, Alice (29)
``` Write a Python function that takes a name and an age and returns a greeting like "Hello, Alice (29)".
```python
def greet(name, age):
return f"Hello, {name} ({age})"
```
Example:
```python
print(greet("Alice", 29))
# Hello, Alice (29)
``` Write a Python function that takes a name and an age and returns a greeting like "Hello, Alice (29)".
```python
def greet(name, age):
return f"Hello, {name} ({age})"
```
Example:
```python
print(greet("Alice", 29))
# Hello, Alice (29)
``` …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 takes a name and an age and returns a greeting like "Hello, Alice (29)".
Of course! Here are a few ways to write that function in Python, starting with the most modern and recommended approach.
### 1. Using f-strings (Recommended)
This is the most common and readable way to format strings in modern Python (version 3.6+).
```python
def greet(name: str, age: int) -> str:
"""
Creates a greeting string with a name and age.
Args:
name (str): The name of the person.
age (int): The age of the person.
Returns:
str: A formatted greeting string like "Hello, [Name] ([Age])".
"""
return f"Hello, {name} ({age})"
# --- Example Usage ---
# Call the function and store the result in a variable
greeting_for_alice = greet("Alice", 29)
print(greeting_for_alice)
# You can also call it directly inside a print statement
print(gre
… Write a Python function that takes a name and an age and returns a greeting like "Hello, Alice (29)".
Of course! The most modern and readable way to do this in Python is by using an f-string.
Here is the function with clear documentation and an example of how to use it.
### Recommended Solution: Using an f-string
This is the preferred method in Python 3.6 and newer. It's clean, fast, and easy to read.
```python
def greet(name: str, age: int) -> str:
"""
Creates a greeting string for a person with their name and age.
Args:
name: The person's name.
age: The person's age.
Returns:
A formatted greeting string like "Hello, [Name] ([Age])".
"""
return f"Hello, {name} ({age})"
# --- Example Usage ---
# Call the function with a name and age
message = greet("Alice", 29)
# Print the result
print(message)
# Another example
print(greet("Bob", 41
… Write a Python function that takes a name and an age and returns a greeting like "Hello, Alice (29)".
Of course! The most modern and recommended way to do this in Python (version 3.6+) is by using an **f-string**.
Here is the function:
```python
def greet(name: str, age: int) -> str:
"""
Creates a formatted greeting string.
Args:
name: The name of the person to greet.
age: The age of the person.
Returns:
A greeting string in the format "Hello, [Name] ([Age])".
"""
return f"Hello, {name} ({age})"
# --- Example Usage ---
# Call the function with a name and age
message = greet("Alice", 29)
# Print the returned message
print(message)
# You can also call it directly inside a print statement
print(greet("Bob", 45))
```
**Output:**
```
Hello, Alice (29)
Hello, Bob (45)
```
### Explanation
1. **`def greet(name: str, age: int) -> str:`**
… …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.21.
Each output got fed through a fight-specific regex classifier.
For python-string-format 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 →