Results for “key”

Showing 21–30 of 62

  1. 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…

    Write the code Easy 2 stages dictionaries keys items JSON
  2. Challenge

    Read the traceback

    …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…

    Fix the code Easy 2 stages errors traceback KeyError TypeError
  3. Article Mini projects

    Medical dispenser - Don’t trust the user

    …# 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…

  4. Challenge

    Unit converter

    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…

    Write the code Medium 2 stages project dictionaries tuples as keys functions
  5. Article Mini projects

    Managing Astronaut Medical Data with Python

    …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…

  6. Challenge

    JSON out

    …keep the station's Polish letters readable and sort the keys so the files compare easily.

    Write the code Easy 2 stages json json.dumps modules import
  7. Article Mini projects

    Calculating Escape Velocity in Python

    …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…

  8. Challenge

    Config loader

    …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…

    Write the code Hard 3 stages project json configuration validation