Two Color Digits

On resistors, the first color bands encode the digits of the resistance value. The function value receives a list colors and uses the first two colors to build a two-digit number. The first color gives the tens digit, and the second color gives the ones digit.

Примеры

Ввод
["brown", "black"]
Вывод
10
Ввод
["blue", "grey"]
Вывод
68
Ввод
["yellow", "violet"]
Вывод
47

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

def value(colors: list[str]) -> int:

Теги

listsstrings
PostgreSQLv16

Tu sa zobrazí výsledok spustenia kódu

Visible tests
1
Input
["brown","black"]
Expected10
2
Input
["blue","grey"]
Expected68
3
Input
["yellow","violet"]
Expected47
4
Input
["white","white","white"]
Expected99
5
Input
["black","brown"]
Expected1
6
Input
["brown","black","brown"]
Expected10
Focus radio
Paused · SomaFM · Fluid