Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Given a string A representing a roman numeral. Convert A into integer. A is guaranteed to be within the range from 1 to 3999. Input

Given a string A representing a roman numeral.

Convert A into integer.

A is guaranteed to be within the range from 1 to 3999.

Input Format

The only argument given is string A.

Output Format

Return an integer which is the integer verison of roman numeral string.

For Example

Input 1:

A = "XIV"

Output 1:

14

Input 2:

A = "XX"

Output 2:

20

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

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_2

Step: 3

blur-text-image_3

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

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions

Question

1. What constitutes the bulk of Harley-David- son's new products?

Answered: 1 week ago

Question

Define Marketing research.

Answered: 1 week ago

Question

1. What is blood circulation? 2. Three types of blood vessels?

Answered: 1 week ago

Question

Why are red blood cells Red in colour?

Answered: 1 week ago