Base Converter

Numbers can be written in many bases, not just decimal: for example, binary, base five, or hexadecimal. Given a non-negative integer number and a base base from 2 to 36, convert the number to that base. Return the result as a string, using Latin letters for digits greater than 9.

Примеры

Ввод
0, 21
Вывод
"0"
Ввод
23, 2
Вывод
"10111"
Ввод
58, 5
Вывод
"213"

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

def int_to_base(number: int, base: int) -> str:

Теги

math
PostgreSQLv16

Tu sa zobrazí výsledok spustenia kódu

Visible tests
1
Input
0, 21
Expected"0"
2
Input
23, 2
Expected"10111"
3
Input
58, 5
Expected"213"
4
Input
167, 16
Expected"A7"
5
Input
57, 5
Expected"212"
6
Input
1000, 16
Expected"3E8"
Focus radio
Paused · SomaFM · Fluid