Quiz
Python Dictionaries Quiz
Free beginner quiz on Python dictionaries: 15 questions on keys and values, get(), in, pop(), update(), loops and nested dictionaries. Instant answers.
Showing 1–10 of 20
Quiz
Free beginner quiz on Python dictionaries: 15 questions on keys and values, get(), in, pop(), update(), loops and nested dictionaries. Instant answers.
Challenge
…the API hasn't assigned a pad yet. Predict it, check the keys with in, fix it with get() and a default, then print a list of launches with defaults for any missing field.
Example
Looping through keys, values or key-value pairs of a dictionary.
Challenge
The monitoring system raises the same alert over and over. Group repeats of an alert that come within 60 seconds of the first into one line with a count, in the order they first appeared, then add the…
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
Print the name, provider and status of a launch from a dict shaped like a launch-API response, then list every field the response has with items(), the way you'd inspect an API you haven't used…
Challenge
Extend the feed parser so it stores every reading as a dict with time, sensor, value and unit in a list of records, then let other code pick out one sensor's readings by key.
Challenge
…keep the station's Polish letters readable and sort the keys so the files compare easily.
Challenge
…they haven't changed falls back, then warn about unknown keys instead of saving them.
Article Mini projects
…event_string = json.dumps(event_copy, sort_keys=True) expected_hmac = self._compute_hmac(event_string) if expected_hmac != stored_hmac: raise ValueError(f"HMAC verification failed at event {i}")…