Scoreboard Points

Imagine a football league table where each match score must be turned into points for your team. Write a function points that takes a list games with score strings in the form x:y. Award 3 points for a win, 1 point for a draw, and 0 points for a loss, then return the total.

Примеры

Ввод
["1:0", "2:0", "3:0", "4:0", "2:1", "3:1", "4:1", "3:2", "4:2", "4:3"]
Вывод
30
Ввод
["1:1", "2:2", "3:3", "4:4", "2:2", "3:3", "4:4", "3:3", "4:4", "4:4"]
Вывод
10
Ввод
["0:1", "0:2", "0:3", "0:4", "1:2", "1:3", "1:4", "2:3", "2:4", "3:4"]
Вывод
0

Нужно реализовать

def points(games: list[str]) -> int:

Теги

stringslistsmath
PostgreSQLv16

Tady se objeví výsledek běhu kódu

Visible tests
1
Input
["1:0","2:0","3:0","4:0","2:1","3:1","4:1","3:2","4:2","4:3"]
Expected30
2
Input
["1:1","2:2","3:3","4:4","2:2","3:3","4:4","3:3","4:4","4:4"]
Expected10
3
Input
["0:1","0:2","0:3","0:4","1:2","1:3","1:4","2:3","2:4","3:4"]
Expected0
4
Input
["1:0","2:0","3:0","4:0","2:1","3:1","4:1","3:2","4:2","4:3","1:1","2:2","3:3","4:4","2:2","3:3","4:4","3:3","4:4","4:4"]
Expected40
5
Input
[]
Expected0
6
Input
["1:0","2:0","2:1","3:0","3:1","3:2","4:0","4:1","4:2","4:3"]
Expected30
Focus radio
Paused · SomaFM · Fluid