Line to record
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.
Start the challengePractise what this example shows with these challenges.
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.
Start the challengePrint 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 before.
Start the challengeReading launch["pad"] stops with a KeyError when 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.
Start the challengeReplace a nine-branch elif that maps planets and the Moon to surface gravity with a dict and one get() lookup, keeping the output exactly the same, then loop over the dict for a weight table.
Start the challengeBuild a dict that maps every cargo ID to its record, so any item is found with one lookup instead of a search through the list, then answer a list of requests, including an ID that isn't on the manifest.
Start the challengeWrite 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 offsets for temperatures.
Start the challengeStuck on this example or want to go further? Ask here, or see what others asked.
Log in to ask and reply.
Separate arguments with commas. They're passed on every Run as sys.argv[1:].
Log in or create a free account to save your code and share it with a link. Your code will be waiting here when you come back.