एक ऐसा फ़ंक्शन बनाएं जो 1 से 10 तक की संख्या लेता है और इसके अनुरूप रोमन अंक देता है।
समाधान:

def roman_numeral(num):
    roman = ["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"]
    arabic = [1000,900,500,400,100,90,50,40,10,9,5,4,1]
    result = ""
    i = 0
    while num > 0:
        for _ in range(num // arabic[i]):
            result += roman[i]
            num -= arabic[i]
        i += 1
    return result

for i in range(1, 11):
    print(i, "in Roman numeral:", roman_numeral(i)) 

#आउटपुट
#1 in Roman numeral: I
#2 in Roman numeral: II
#3 in Roman numeral: III
#4 in Roman numeral: IV
#5 in Roman numeral: V
#6 in Roman numeral: VI
#7 in Roman numeral: VII
#8 in Roman numeral: VIII
#9 in Roman numeral: IX
#10 in Roman numeral: X