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
  • Zuletzt geändert: 2024/03/28 14:07
  • von 127.0.0.1