Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

How can i do testing of this in PyCharm. Like input a string as II or IV and it would show values. 1 NP 2

How can i do testing of this in PyCharm.  Like input a string as "II" or "IV" and it would show values.
image

1 NP 2 3 G5 4 6 7 8 9 BEBERGREEE8 10 11 12 13 14 15 16 17 19 20 main.py x class Main: def intToRoman(s: str): m = { "I": 1, "V": 5, "X": 10, "L": 50, "C": 100, "D": 500, "M": 1000, } ans = 0 for i in range (len (s)): if i < len(s) and m[s[i]] < m[s[i + 1]]: ans -= m[s[i]] else: ans += m[s[i]] return ans + N e ...

Step by Step Solution

3.36 Rating (165 Votes )

There are 3 Steps involved in it

Step: 1

To test the intToRoman method in PyCharm you can create a separate Python file and write test cases ... 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

Marketing Research

Authors: Carl McDaniel Jr, Roger Gates

10th Edition

9781118808849

More Books

Students also viewed these Programming questions