← Back to challenges

Get Students with Names and Top Notes

PythonHardarraysobjectsfunctional_programming

Instructions

Create a function that takes a dictionary of objects like { "name": "John", "notes": [3, 5, 4] } and returns a dictionary of objects like { "name": "John", "top_note": 5 }.

Examples

top_note({ "name": "John", "notes": [3, 5, 4] }) ➞ { "name": "John", "top_note": 5 }

top_note({ "name": "Max", "notes": [1, 4, 6] }) ➞ { "name": "Max", "top_note": 6 }

top_note({ "name": "Zygmund", "notes": [1, 2, 3] }) ➞ { "name": "Zygmund", "top_note": 3 }

Notes

N/A

python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: FizzBuzz Interview Question