Code Lab BetaBUILD. RUN. DISCOVER.

Code Lab is in development. New lessons and improvements are on the way. Progress can be deleted.

Challenges / 03

Batch Records.

About 5–10 minutes
Your lesson
Given: rows = [{"w": 64, "h": 1.6}, {"w": 0, "h": 1.7}, {"w": 81, "h": "bad"}]. Write parse_w and parse_h (raise ValueError on bad data) and bmi_of(row). Loop with try/except: on success print round(bmi, 1) and increase ok; on ValueError increase fail. Finally print ok and fail. Expected: 25.0 1 2

Functions finale: helpers + batch processing.

challenge_03.pyPYTHON
Loading the runtime… The first launch may take a little longer.
… 0/20000
CHECKSSTANDBY
01helpers with raise
02ok is 1 and fail is 2
03console is 25.0 / 1 / 2
…0/10000
ConsoleWrite the code. Bring it online.
›
Calculators BG — 50+ free online calculators | Калкулатори БГ