Unit Wrap-Up Assignment (Not a Deliverable):

Objective: Learn how to write functions designed to process data and return a set of values from a dictionary.

Description: Write a function that stores information about student grades.

  1. Create a new Python file. Define a function named, gradeCenter.
    • A. The function should accept a variable/arbitrary number of keyword arguments (no fixed parameters).
  2. Inside the function, initialize an empty dictionary.
    • A. Loop through the keyword arguments the function received.
    • B. As you loop, add each key-value pair to the dictionary you created.
    • C. Return the dictionary.
  3. Call the function, passing in the activity name, score, activity ID, and one other key-value pair (completed=True) as keyword arguments.
    • A. Your function should work for the following call:
python
1wcuStudent = gradeCenter(name='Functions-ReturnValues', 
2                         score=100, 
3                         id=5, 
4                         completed=True)
  1. Print the dictionary that is returned from the function call.

Solution Example:

1{'name': 'Functions-ReturnValues', 'score': 100, 'id': 5, 'completed': True}