ExamVeda
Login
Home
21
What will be the output of the following Python code?
def d(f):
    def n(*args):
        return '$' + str(f(*args))
    return n
@d
def p(a, t):
    return a + a*t 
print(p(100,0))
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
22
What will be the output of the following Python expression if the value of x is 34?
print(“%f”%x)
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
23
The . . . . . . . . symbol along with the name of the decorator function can be placed above the definition of the function to be decorated works as an alternate way for decorating a function.
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
24
Which module must be imported to use the @abstractmethod decorator in Python?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
25
What is the output of the code: print("{:<10}".format("hello"))?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
26
The output of the two codes shown below is the same.
i. '{0:.2f}'.format(1/3.0)
ii. '%.2f'%(1/3.0)
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
27
What will be the output of the following Python code?
'{0:f}, {1:2f}, {2:05.2f}'.format(1.23456, 1.23456, 1.23456)
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
28
What will be the output of the following Python code?
'{a}, {0}, {abc}'.format(10, a=2.5, abc=[1, 2])
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
29
The formatting method {1:<10} represents the . . . . . . . . positional argument, . . . . . . . . justified in a 10 character wide field.
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
30
What will be the output of the following Python code?
def c(f):
    def inner(*args, **kargs):
        inner.co += 1
        return f(*args, **kargs)
    inner.co = 0
    return inner
@c
def fnc():
    pass
if __name__ == '__main__':
    fnc()
    fnc()
    fnc()
    print(fnc.co)
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board