im pretty new to programming and trying to learn Python. I tried to write a simple code which transforms an integer into roman numerals. I´m searching for a method to transofrm the list I created into something like MCCVI. For now its enough if the integer exp. 1523 is written like MDXXIII. Here is my code:
a= int(input("Geben sie eine Zahl ein:"))
M=1000
D=500
C=100
L=50
X=10
V=5
I=1
liste= ["M","D","C","L","X","V","I"]
i=0
erg=[]
while i < len(liste):
while a > eval(liste[i]):
a = a- eval(liste[i])
erg += liste[i]
i+=1
print(erg)