Challenge
API response
…Lumen-3 Provider: JAXA Status: Go Read a value with its key in square brackets: launch["name"] . Inside an f-string, use single quotes for the key: {launch['name']} . Everything in the response Before…
Showing 21–30 of 62
Challenge
…Lumen-3 Provider: JAXA Status: Go Read a value with its key in square brackets: launch["name"] . Inside an f-string, use single quotes for the key: {launch['name']} . Everything in the response Before…
Quiz
…arguments into a tuple and **kwargs collects extra keyword arguments into a dictionary. This free quiz has 15 short questions on both, and on * and ** in function calls. What the quiz covers What…
Challenge
…in average_kelvin File "script.py", line 10, in to_kelvin KeyError: 'temperature_c' Read it from the bottom: the last line is the error, and the File line just above it is where it happened. Fill in…
Article Mini projects
…# In production: use hardware security module or secure key storage secret = os.urandom(32) print("Warning: Using randomly generated secret. Set MEDICATION_DISPENSER_SECRET environment variable for…
Challenge
Write convert(), which looks a unit pair up in a table of factors, works the other way round by dividing, and refuses unknown units or missing pairs with a clear ValueError, then extend the table with…
Challenge
Give send_command(cmd, retries=3, timeout=5.0) default values so callers only pass what differs, call it three different ways, then add a new priority parameter without breaking any existing call.
Article Mini projects
…CREATE TABLE IF NOT EXISTS astronauts ( id INTEGER PRIMARY KEY, name TEXT NOT NULL, age INTEGER, nationality TEXT ) ''') cursor.execute(''' CREATE TABLE IF NOT EXISTS medical_records ( id INTEGER…
Challenge
…keep the station's Polish letters readable and sort the keys so the files compare easily.
Article Mini projects
…WITH NUMPY") print("="*50) names = list(planets.keys()) masses = np.array([planets[p]["mass"] for p in names]) radii = np.array([planets[p]["radius"] for p in names]) # Calculate all escape velocities…
Challenge
…hand. Last week someone typed "256" in quotes, misspelt a key and set twelve retries, and the module started with the wrong settings without a word. Write the loader that fills in what is missing…