inNumber = input('Please enter a number (1-10) to be converted to a roman numeral: ') print if inNumber <= 0: print "Sorry, but this number is not in the range of numbers specified. Please try again." elif inNumber == 1: print "The Roman numeral is for 1 is I" elif inNumber == 2: print "The Roman numeral is for 2 is II" elif inNumber == 3: print "The Roman numeral is for 3 is III" elif inNumber == 4: print "The Roman numeral is for 4 is IV" elif inNumber == 5: print "The Roman numeral is for 5 is V" elif inNumber == 6: print "The Roman numeral is for 6 is VI" elif inNumber == 7: print "The Roman numeral is for 7 is VII" elif inNumber == 8: print "The Roman numeral is for 8 is VIII" elif inNumber == 9: print "The Roman numeral is for 9 is IX" elif inNumber == 10: print "The Roman numeral is for 10 is X" elif inNumber > 10: print "Sorry, but this number is not in the range of numbers specified. Please try again."
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