The 2024 European Championship is in full swing. The following assignment is based on the Sporza European Championship prediction contest and uses the match functions from the previous assignment.
Import the file wedstrijd.py so you can use the functions defined in this file.
Define 2 global variables:
RESULTS
: a list to keep track of all match resultsPREDICTIONS
: a list to keep track of predictions for the matchesDefine a function add_match
with a match as a parameter (see Match assignment).
If the match corresponds to a result, it will be added
to the global variable RESULTS
. If it is a prediction, the match
will be added to the PREDICTIONS
.
Define a function score_prediction
with as parameter a prediction. The function returns the points one gets for the prediction
by searching the results for the corresponding result and then returning the points. If
the match is not found, the function returns 0.
Define a function score_player
with as parameter the name of the player . The function returns the number of points a player has scored by adding up the points
they have earned for each prediction.