Created
September 17, 2014 21:29
-
-
Save fanglinchen/256795a0a361b5005276 to your computer and use it in GitHub Desktop.
Integer to Roman (1)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for i,value in enumerate(numbers): | |
quotient = num/value | |
for once in xrange(quotient): | |
if res == '': | |
res = letters[i] | |
else: | |
res = res + letters[i] | |
num = num%value | |
return res |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment