llmcoderlab

Temperature conversion

llama3.2-3b Pythonagenticrun 2sample 05.1s 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

write_fileturn 1 · temperature.py · 144 B
run_teststurn 2 ·
✓ tests green4 passed
doneturn 3 ·
✓ done — gate green
graded 100.04 passed, 0 failed
pytest output
....                                                                     [100%]
4 passed in 0.00s

03 what it wrote

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

stdlib imports: none

FileLOCSLOC FnsComplexityDepthImports
temperature.py54211
temperature.py · 5 lines · 144 B
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
3
model calls
0
invalid actions
1
self test runs
91
tokens out
tokens in
5.1s
wall time

agent actions: write_file×1, run_tests×1, done×1

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