I'm very new to programming so please help me with this!
I wish to print all the values of roman_numeral_map
in the command line, but I get lots of errors.
Here is my code:
class roman1:
roman_numeral_map = (('M', 1000),
('CM', 900),
('D', 500),
('CD', 400),
('C', 100),
('XC', 90),
('L', 50),
('XL', 40),
('X', 10),
('IX', 9),
('V', 5),
('IV', 4),
('I', 1))
def to_roman():
'''convert integer to roman numeral'''
for numeral, integer in roman_numeral_map:
print(numeral, integer)
if __name__ == '__main__':
self.roman = roman1()
roman.to_roman
UPDATE:
This is the traceback I get (thanks)!
Traceback (most recent call last):
File "/Users/michaelmatos/PycharmProjects/diveintopython3/roman1.py", line 4, in <module>
class roman1:
File "/Users/michaelmatos/PycharmProjects/diveintopython3/roman1.py", line 27, in roman1
self.roman = roman1()
NameError: name 'roman1' is not defined