Question: Given an integer A, convert it to a roman numeral, and return a string corresponding to its roman numeral version Input Format The only argument

Given an integer A, convert it to a roman numeral, and return a string corresponding to its roman numeral version

Input Format

The only argument given is integer A.

Output Format

Return a string denoting roman numeral version of A.

Constraints

1 <= A <= 3999

For Example

Input 1:

A = 5

Output 1:

"V"

Input 2:

A = 14

Output 2:

"XIV"

Please note that python code for above question should pass large test cases, and all corner test cases, reasoning for below MCQs is also needed, please dont copy (unhelpful if copied or didn't answer all)

1. Which of the following functions will return the symmetric difference between two sets, x and y?

a) x | y

b) x ^ y

c) x & y

d) x - y

2. What will be the output of the following Python code snippet?

z=set('abc$de')

'a' in z

a) True

b) False

c) No output

d) Error

3. What will be the output of the following Python code snippet?

z=set('abc')

z.add('san')

z.update(set(['p', 'q']))

z

a) {'abc', 'p', 'q', 'san'}

b) {'a', 'b', 'c', ['p', 'q'], 'san}

c) {'a', 'c', 'c', 'p', 'q', 's', 'a', 'n'}

d) {'a', 'b', 'c', 'p', 'q', 'san'}

4. What will be the output of the following Python code snippet?

s=set([1, 2, 3])

s.union([4, 5])

s|([4, 5])

a)

{1, 2, 3, 4, 5}

{1, 2, 3, 4, 5}

b)

Error

{1, 2, 3, 4, 5}

c)

{1, 2, 3, 4, 5}

Error

d)

Error

Error

5. What will be the output of the following Python code snippet?

for x in set('pqr'):

print(x*2)

a)

pp

qq

rr

b)

pqr

pqr

c) ppqqrr

d) pqrpqr

6. What will be the output of the following Python code snippet?

{a**2 for a in range(4)}

a) {1, 4, 9, 16}

b) {0, 1, 4, 9, 16}

c) Error

d) {0, 1, 4, 9}

7. What will be the output of the following Python function?

{x for x in 'abc'}

{x*3 for x in 'abc'}

a)

{abc}

aaa

bbb

ccc

b)

abc

abc abc abc

c)

{'a', 'b', 'c'}

{'aaa', 'bbb', 'ccc'}

d)

{'a', 'b', 'c'}

abc

abc

abc

8. The output of the following code is: class<'set'>.

type({})

a) True

b) False

9. What will be the output of the following Python code snippet?

a=[1, 4, 3, 5, 2]

b=[3, 1, 5, 2, 4]

a==b

set(a)==set(b)

a)

True

False

b)

False

False

c)

False

True

d)

True

True

10. What will be the output of the following Python code snippet?

l=[1, 2, 4, 5, 2, 'xy', 4]

set(l)

l

a)

{1, 2, 4, 5, 2, 'xy', 4}

[1, 2, 4, 5, 2, 'xy', 4]

b)

{1, 2, 4, 5, 'xy'}

[1, 2, 4, 5, 2, 'xy', 4]

c)

{1, 5, 'xy'}

[1, 5, 'xy']

d)

{1, 2, 4, 5, 'xy'}

[1, 2, 4, 5, 'xy']

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!