ExamVeda
Login
Home
11
What will be the output of the following Python code?
>>>example = "helle"
>>>example.rfind("e")
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
12
What will be the output of the following Python code snippet?
print('abcefd'.replace('cd', '12'))
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
13
What will be the output of the following Python code?
print("abcdef".find("cd"))
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
14
What will be the output of the following Python code?
>>>print (r"\nhello")
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
15
Suppose s is “\t\tWorld\n”, what is s.strip()?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
16
What will be the output of the following Python code?
class father:
    def __init__(self, param):
        self.o1 = param
 
class child(father):
    def __init__(self, param):
        self.o2 = param
 
>>>obj = child(22)
>>>print "%d %d" % (obj.o1, obj.o2)
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
17
What will be the output of the following Python code snippet?
print('The sum of {0:b} and {1:x} is {2:o}'.format(2, 10, 12))
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?
print("xyyzxyzxzxyy".count('yy', 1))
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
19
What will be the output of the following Python code snippet?
print(''''''.isspace())
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
20
To retrieve the character at index 3 from string s="Hello" what command do we execute (multiple answers allowed)?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board