Roman Number Form

Roman numerals still appear on clocks, in book chapters, and in event numbering. The function roman receives a natural number number from 1 to 3999 and converts it to a Roman numeral string. Pay attention to special cases like 4 and 9, where subtraction is used.

Примеры

Ввод
1
Вывод
"I"
Ввод
4
Вывод
"IV"
Ввод
9
Вывод
"IX"

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

def roman(number: int) -> str:

Теги

stringsmath
PostgreSQLv16

Qui apparirà il risultato dell'esecuzione del codice

Visible tests
1
Input
1
Expected"I"
2
Input
4
Expected"IV"
3
Input
9
Expected"IX"
4
Input
49
Expected"XLIX"
5
Input
1990
Expected"MCMXC"
6
Input
2008
Expected"MMVIII"
Focus radio
Paused · SomaFM · Fluid