Rattlesnake 2

From Grundy

Date: 8th October 2017

Youtube Problem Statement:https://www.youtube.com/watch?v=DrIOkmOVjzM


Problem Statement

Write a program in Python to convert a Roman numeral into its equivalent decimal number and vice-versa. The program should run in a loop and should continue asking the user if he wants to quit. If the user wants to continue, he should be prompted to choose whether to enter a Roman or Decimal number, and then asked to enter the number itself.

Input format: Input format isn't strict. However, you should follow the following sequence of prompts. First, the program should give a choice to enter a roman or decimal number. Then, the program should prompt to enter the number. After the correct answer is given, the program should sak the user whether to quit.

Output format: For each number, print its equivalent.

Example:

Enter R/A to enter the Roman/Arabic(decimal) number.
- R
Enter the number in Roman.
- XL
The decimal equivalent is 40
Do you want to try again? (Y/N)
- Y
Enter R/A to enter the Roman/Arabic(decimal) number.
-A
Enter the number in decimal.
-231
The Roman equivalent is CCXXXI
Do you want to try again? (Y/N)
-N


See also