#Roman Numeral Translator #Isaac Martinotti #CIS 122 def main() : #Introduction Message print('This Program converts numbers into roman numerals.') print #Gather Information arabic = input("Please enter a whole number between 1 and 10") print rnumeral = ['I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX', 'X'] #Check For Errors if arabic < 1 : print('That number is too small.') elif arabic > 10 : print('That number is too big.') #Integer Check else : if float(arabic).is_integer() : #Print Answer print 'Your roman numeral is:', rnumeral[int(arabic) - 1] else : print('Error: Not a whole number.') main()
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question