Challenge: The Champions League
Opgave
Swipe to start coding
Imagine we have a table with the final results of the qualification round for the Champions League. Let's store the teams with first and second place in the team_a
and team_b
. The third team save in the team_c
variable. Save the team with the fewest points in the last team_d
variable. We will use these variables to print the announcements.
Please don't change the print statements and the function.
Your task is simply to unpack the list group_c within the function call parameters.
Løsning
9
1
2
3
4
5
6
7
8
9
def announcements(team_a, team_b, team_c, team_d):
print(f"The teams that move to the next round are {team_a} and {team_b}.")
print(f"The team that will play in the Europa League group stage is {team_c}.")
print(f"{team_d} is out of the Champions League.")
group_c = ["Bayern", "Inter", "Barcelona", "Viktoria Plzen"]
announcements(*group_c)
Var alt klart?
Tak for dine kommentarer!
Sektion 1. Kapitel 5
9
1
2
3
4
5
6
7
8
def announcements(team_a, team_b, team_c, team_d):
print(f"The teams that move to the next round are {team_a} and {team_b}.\n"
f"The team that will play in the Europa League group stage is {team_c}.\n"
f"{team_d} is out of the Champions League.")
group_c = ["Bayern", "Inter", "Barcelona", "Viktoria Plzen"]
announcements(___)
Spørg AI
Spørg om hvad som helst eller prøv et af de foreslåede spørgsmål for at starte vores chat