llmcoderlab

Temperature conversion

llama3.2-3b Pythononeshotrun 2sample 03.3s wall

← run 2 · raw JSON · challenge definitions

100
score
tests (60%)4/4 passed
deliverables (20%)100%
content checks (20%)100%

01 what the model was asked

Create temperature.py with exactly two functions:

c_to_f(celsius: float) -> float
    Convert Celsius to Fahrenheit: F = C * 9/5 + 32.

f_to_c(fahrenheit: float) -> float
    Convert Fahrenheit to Celsius: C = (F - 32) * 5/9.

Use only the Python standard library.
required deliverables + checks
deliverable: temperature.py
temperature.py must contain “def c_to_f”
temperature.py must contain “def f_to_c”
pytest suite it was graded against
test_temperature.py · 20 lines · 357 B
from temperature import c_to_f, f_to_c  def test_freezing():    assert c_to_f(0) == 32    assert f_to_c(32) == 0  def test_boiling():    assert c_to_f(100) == 212    assert f_to_c(212) == 100  def test_negative():    assert c_to_f(-40) == -40    assert f_to_c(-40) == -40  def test_round_trip():    assert abs(f_to_c(c_to_f(37.5)) - 37.5) < 1e-9

02 what it did — full transcript

promptthe exact instruction sent to the model
view full prompt
You are completing a coding task in one shot. Write complete files that satisfy the spec below. Tests (pytest) will be run against your files; you cannot run them yourself.

Reply with ONE JSON object and nothing else:
{"files": {"<relative path>": "<complete file content>", ...}}

Required deliverable files: temperature.py

SPEC:
Create temperature.py with exactly two functions:

c_to_f(celsius: float) -> float
    Convert Celsius to Fahrenheit: F = C * 9/5 + 32.

f_to_c(fahrenheit: float) -> float
    Convert Fahrenheit to Celsius: C = (F - 32) * 5/9.

Use only the Python standard library.
reply68 tokens
view raw reply
{"files": {"temperature.py": "import math\n\ndef c_to_f(celsius: float) -> float:\n    return celsius * 9/5 + 32\n\ndef f_to_c(fahrenheit: float) -> float:\n    return (fahrenheit - 32) * 5/9"}}
write_filetemperature.py · 155 B
graded 100.04 passed, 0 failed
pytest output
....                                                                     [100%]
4 passed in 0.00s

03 what it wrote

1
files
7
lines
5
source lines
2
functions
0
classes
1
cyclomatic
1
max nesting
2.0
avg fn lines

stdlib imports: math

FileLOCSLOC FnsComplexityDepthImports
temperature.py75211math
temperature.py · 7 lines · 155 B
import math def c_to_f(celsius: float) -> float:    return celsius * 9/5 + 32 def f_to_c(fahrenheit: float) -> float:    return (fahrenheit - 32) * 5/9

04 how it was graded

✓ ok 4/4 passed
1
model calls
0
invalid actions
0
self test runs
68
tokens out
tokens in
3.3s
wall time

agent actions:

final pytest output
....                                                                     [100%]
4 passed in 0.00s