is_roman_numeral

plasmapy.utils.roman.is_roman_numeral(s: str) bool[source]

Check whether or not a string is a valid Roman numeral.

Parameters:

s (str) – The possible Roman numeral.

Returns:

resultTrue if the str input is a valid Roman numeral, and False if it is not.

Return type:

bool

Raises:

TypeError – If the argument is not a str.

See also

to_roman, from_roman

Examples

>>> is_roman_numeral("CXVII")
True
>>> is_roman_numeral("42")
False