lambda function and map to accomplish this task.

Create a function that takes a list of dictionaries, where each dictionary represents a student with "name" and "marks" keys, and returns a new list of dictionaries with an additional key "status". The "status" should be "pass" if the "marks" is greater than or equal to 60, otherwise "fail". Use function, lambda function and map to accomplish this task.

students = [ {"name": "John", "marks": 80}, {"name": "Jane", "marks": 45}, {"name": "Bob", "marks": 70}, {"name": "Alice", "marks": 35}]
[ {"name": "John", "marks": 80}, {"name": "Jane", "marks": 45}, {"name": "Bob", "marks": 70}, {"name": "Alice", "marks": 35}]
Total : 0 Discussion
Login