ExamVeda
Login
Home
1
Which function is used to format strings in Python?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
2
In Python, what does the % operator do when used for string formatting?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
3
Which of the following is an f-string in Python?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
4
What will be the output of the following Python expression if x=22.19?
print("%5.2f"%x)
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
5
The expression shown below results in an error.
print("-%5d0",989)
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
6
In Python, what does the expression {:.2e} do in a formatted string?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
7
What is the purpose of the @wraps decorator in Python's functools module?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
8
What will be the output of the following Python code?
s='{0}, {1}, and {2}'
s.format('hello', 'good', 'morning')
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
9
What will be the output of the following Python code?
'%x %d' %(255, 255)
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
10
What will be the output of the following Python code?
class A:
    @staticmethod
    def a(x):
        print(x)
A.a(100)
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board