Ex10 - Passing Arguments to Functions:

Objective: Practice learning ways to pass information to functions using different types of arguments and parameters.

Description: Create a new Python file named, Ex10-Functions.py. Write three functions that each accept the exercise name (Functions) and a score (100) as arguments. In each function body, use the parameters to print the exercise name and score to the terminal output.

  • The third function must also accept an arbitrary number of keyword arguments in addition to exerciseName and score. Pass the exercise ID (10) using one of these arbitrary keyword arguments. Call each function as specified below:

  1. Call the first function, defined as, gradeCenter using positional arguments.
  2. Call the second function, defined as, gradeCenterKwargs using keyword arguments.
  3. Call the third function, defined as, gradeCenterVarargs using variable/arbitrary keyword arguments.
  4. Place each function call immediately after its function definition.
  • Solution Output:

1Exercise Name: Functions.
2Score: 100
3
4Exercise Name: Functions.
5Score: 100
6
7Exercise Name: Functions.
8Score: 100 
9ExerciseID: 10