Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def checkio(data):
- ROMA = ['M', 'CM', 'D', 'CD', 'C', 'XC', 'L', 'XL', 'X', 'IX', 'V', 'IV', 'I']
- DEC = [1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1]
- i = 0
- x = ''
- while i < len(DEC):
- if data < DEC[i]:
- i += 1
- else:
- data -= DEC[i]
- x += ROMA[i]
- return str(x)
- print(checkio(3410))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement