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
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started