Načítání úlohy…
Binary notation stores numbers using only 0 and 1, just like computers do internally. Write parse_binary, which manually converts the string digits from binary to a decimal integer without using int(x, 2). If the string contains any character other than 0 or 1, raise ValueError.
"0"0"1"1"100"4def parse_binary(digits: str) -> int:
Přihlaste se, abyste viděli historii odevzdání
Přihlásit sePřihlaste se, abyste mohli použít AI mentora
Přihlásit se"0"0"1"1"100"4"1001"9"11010"26"10001101000"1128