ExamVeda
Login
Home
11
What is the primary use of the @staticmethod decorator?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
12
What will be the output of the following Python code?
def f(x):
    def f1(a, b):
        print("hello")
        if b==0:
            print("NO")
            return
        return f(a, b)
    return f1
@f
def f(a, b):
    return a%b
f(4,0)
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
13
In Python, what is the purpose of the @classmethod decorator?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
14
The following python code can work with . . . . . . . . parameters.
def f(x):
    def f1(*args, **kwargs):
           print("Examveda")
           return x(*args, **kwargs)
    return f1
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
15
What will be the output of the following two codes?
i. '{0}'.format(4.56)
ii. '{0}'.format([4.56,])
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
16
In Python, what is the purpose of the locals() function?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
17
What will be the output of the following Python expression if X=345?
print(“%06d”%X)
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
18
What will be the output of the following Python code?
l=list('HELLO')
p=l[0], l[-1], l[1:3]
'a={0}, b={1}, c={2}'.format(*p)
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
19
What will be the output of the following Python code?
def mk(x):
    def mk1():
        print("Decorated")
        x()
    return mk1
def mk2():
    print("Ordinary")
p = mk(mk2)
p()
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
20
What will be the output of the following Python code snippet?
x=3.3456789
'%s' %x, str(x)
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board