Implement a function add_viewer() for an esports tournament viewing party. This function should handle two types of viewers: fans of specific teams and general viewers.
The function should:
Accept two parameters:
name: A string representing the person's name (required)fan_list: An optional list of existing fans (if a person does not have a favorite team yet, this argument should not be passed to the function)
Behave as follows:
If
fan_listis provided, add thenameto this list and return the updated list.If
fan_listis not provided (a person is not a fan of any particular team), create a new list with only thenameand return it.
You only need to implement the function. Do not handle input or call the function in your code.