Python  1.0
Functions | Variables
validateRoman Namespace Reference

Functions

def validateRoman (r)
 Validates a roman numeral. More...
 
def reRoman (r)
 Validates a roman numeral using regular expressions. More...
 
def main (argv=None)
 Main program. More...
 

Variables

 xrange = range
 
 raw_input = input
 

Function Documentation

◆ main()

def validateRoman.main (   argv = None)

Main program.

Converts roman numerals to decimals or vice-versa.

Parameters
argvcommand line arguments.
  • argv[0]: /Library/WebServer/Documents/python/labs/validateRoman.py (macOS)
  • argv[1]: value to convert
See also
https://developers.google.com/edu/python/regular-expressions
https://www.regular-expressions.info

References _02c_int2roman.int2roman(), raw_input, reRoman(), _03a_roman2int.roman2int(), and xrange.

◆ reRoman()

def validateRoman.reRoman (   r)

Validates a roman numeral using regular expressions.

Parameters
rroman numeral to be validated in the range [1,3999].
Returns
true if there is a match between the regular expression and the string r. Otherwise, false.

Referenced by main().

◆ validateRoman()

def validateRoman.validateRoman (   r)

Validates a roman numeral.

Parameters
rroman numeral to be validated.
Returns
an error code string, or an empty string, if no error has occurred.

Variable Documentation

◆ raw_input

validateRoman.raw_input = input

◆ xrange

validateRoman.xrange = range

Referenced by main().