# Roman Numeral Conversion # by Robert Layton # Welcome user and get input print 'Welcome to the Roman numeral conversion tool!' Num = input('Please enter a number between 1 and 10\n') # Dictionary of roman numeral conversions RomanNumerals = {1: 'I', 2: 'II', 3: 'III', 4: 'IV', 5: 'V', 6: 'VI', 7: 'VII', 8: 'VIII', 9: 'IX', 10 : 'X' }; # Print results if(Num < 1) or (Num > 10): print 'Invalid number!' else: print 'The Roman Numeral for ',Num,' is ', RomanNumerals[Num]
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