← Back to Dictionaries
Question 299
Record As Key Colon Value
Record As Key Colon Value
Loop over the student record and print one line per field in the form <key>: <value> using a print call with sep=': ', so that the grades list prints as Python shows a list. After the loop print a final line <count> fields where the count is the length of the dict. Input: none. Output: four field lines in insertion order, then the count line.
Expected Output:
first_name: Giselle age: 21 gpa: 3.8 grades: [74.25, 31.0, 68.0] 4 fields
= newline. The output ends with a newline — print one after the last line.
Hints3 available
Sign in to use hintsTopics:
Dictionaries
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.