← Back to Files
Question 434
Find A Student In JSON
Find A Student In JSON
Save students to students.json with json.dump and indent=2, then read a name from input and load the list back with json.load into loaded. Print <n> records with the length of loaded first; then search the loaded list and print <name>: <grade> for the record whose name matches, or No record for <name> after the search when none does. Input: one line, no prompt. Import only json.
Expected Output:
3 records Omar: 92
= newline. The output ends with a newline — print one after the last line.
Hints4 available
Sign in to use hintsTopics:
FilesJSON
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Ctrl+Space to expand shortcuts (pr, inp, def)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.