Question: I'd like to write a python program that works in roman numerals, (i.e. you type in inputs in Roman Numerals and it gives you the
I'd like to write a python program that works in roman numerals, (i.e. you type in inputs in Roman Numerals and it gives you the answer back in Roman Numerals). It needs to calculate in +-* operators. I have managed to write the first part of the program that defines the conversions but I'm not sure how to implement that into a calculator with user input. The first half is attached.
def Romantoint(value): #Adapted from a piece of code written by Arnab Chakraborty on tutorialspoint.com will convert from Roman Numerals to Integers." This is achieved using A Dictionary And A key system roman = {1:1, 'V':5, 'X':18, 'L':58, 'c':180, 'D':500,"M":1000, 'IV": 4, "IX':9, 'XL:40, xc9:9e, 'c':488, 'CH":900) i rinitiolisation of Local variables nume while i e: for - in range (value Il num[i]): roman nun += sym[i] value -- nuntil i 1 return roman_num
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
