Parsing nested API responses — without crashing on a missing key — step 5 of 9
Cursor wrote a loop that iterates a possibly-missing tags field on
a response. To loop safely whether tags is present or not, the
default needs to be an iterable.
Fill in the default value passed to .get on line 4 so the loop
doesn't crash when tags is missing. The result for the first
response should print nothing (no tags), and the second should print
python and api on two lines.
Default value:
Parsing nested API responses — without crashing on a missing key — step 5 of 9
Cursor wrote a loop that iterates a possibly-missing tags field on
a response. To loop safely whether tags is present or not, the
default needs to be an iterable.
Fill in the default value passed to .get on line 4 so the loop
doesn't crash when tags is missing. The result for the first
response should print nothing (no tags), and the second should print
python and api on two lines.
Default value: