wdscxsj / roman

Integer to Roman numerals converter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

https://travis-ci.com/zopefoundation/roman.svg?branch=master https://coveralls.io/repos/github/zopefoundation/roman/badge.svg?branch=master Current version on PyPI Supported Python versions

roman

Small helper library to convert arabic to roman numerals.

There are two ways to use this library.

  1. Importing it into your application
import roman

# to roman
number = int(input('> ')) # 10
print(roman.toRoman(number))

# from roman
number = input('> ') # X
print(roman.fromRoman(number))
  1. roman CLI command
~$ roman 972
CMLXXII
# use the -r/--reverse to convert Roman numerals
~$ roman -r CMLXXII
972
# case insensitive
~$ roman -r cMlxxii
972

About

Integer to Roman numerals converter

License:Other


Languages

Language:Python 100.0%