Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a python function that, converts Roman numerals to values. Go only till 20 (Roman: XX). Input: Roman Numerals. Output: Decimal Equivalent. I: 1, V:5,

Write a python function that, converts Roman numerals to values. Go only till 20 (Roman: XX). Input: Roman Numerals. Output: Decimal Equivalent.

I: 1, V:5, X:10

Program ends when x is entered

Sample Output:

Please enter the Roman Numeral: XII

The Number is: 12

Please enter the Roman Numeral: XV

The Number is:: 15

Please enter the Roman Numeral: III

The Number is:: 3

Please enter the Roman Numeral: x

Good Bye !

my idea

def roman_count(sting)

count

How to count I=1, V=5, X=10?

for I in string:

if I in x

count += 1

for V in x

count += 5?

use a loop while to ask for input and run function

while true :

string = input("Please enter Roman")

if string == x

print ("Good bye")

else

print( -this should be pulling the function)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Database Relational Model A Retrospective Review And Analysis

Authors: C. J. Date

1st Edition

0201612941, 978-0201612943

More Books

Students also viewed these Databases questions