The Euro 2024 is in full swing. To develop a prediction app, several functions are needed to keep track of, display, and compare matches and predictions.

Task: Match Function (2 points)

Define a function match. The function has 4 parameters:

The function also has two default arguments:

The function will store the match in a list where for a result, team1 will be stored in the first position of the list, team2 in the second position, score_team1 in the third position, and score_team2 in the fourth position. For a prediction, the name of the player will also be added to the list.

Task: Is Prediction Function (1 point)

Define a function is_prediction. The function takes a list corresponding to a match (see match function). If the match corresponds to a prediction, the function returns True, otherwise False.

Task: Winner Function (1 point)

Define a function winner with an argument that corresponds to a list representing a match (see match function). The function returns the name of the team with the highest score. If the match is a draw, it returns "DRAW".

Task: Print Match Function (2 points)

Define a function print_match with an argument that corresponds to a list representing a match (see match function). The function prints the match for a result:

Turkey             1-1              Georgia

For a prediction:

Prediction Lewis       : Belgium              1-1            Slovakia

Task: Print Matches Function (2 points)

Define a function print_matches with an argument that is a list of matches corresponding to lists (see match function). The function prints the matches from the list line by line, first giving an overview of the results and then of the predictions:

Results:
Turkey             1-1              Georgia
Portugal           1-1              Czech Republic
Romania            0-0              Ukraine
Belgium            1-1              Slovakia
Poland             2-2              Netherlands
Austria            1-1              France
Poland             2-2              Netherlands
Slovenia           1-1              Denmark
Serbia             1-1              England
Spain              0-0              Croatia
Italy              1-1              Albania
Germany            1-1              Scotland
Hungary            5-5              Switzerland
Predictions:
Prediction Lewis       : Belgium              1-1            Slovakia
Prediction Alexander   : Belgium              1-1            Slovakia

Task: Check Prediction Function (2 points)

Define a function check_prediction with arguments match_result and prediction, both corresponding to lists (see match function). The function returns the points earned for the prediction based on the following rules: