LU05.L04: Römische Zahlzeichen

numerals = ['M', 'D','C','L','X','V','I']
decimals = [1000, 500, 100, 50, 10, 5, 1]
count = 0
result = ''
 
number = int(input('Dezimalzahl > '))
while number > 0:
    if (number >= decimals[count]):
        result += numerals[count]
        number = number - decimals[count]
    else:
        count = count + 1
print (result)
  • modul/archiv/m319python/learningunits/lu05/loesungen/roemisch.txt
  • Last modified: 2023/11/13 08:56
  • by 127.0.0.1