Question 1 of 25
Hints left: 3
Q1
What will be the output of the following Python code snippet? print('cd'.partition('cd'))
Q2
What will be the output of the following Python code snippet? print('for'.isidentifier())
Q3
What will be the output of the following Python code? print('abc'.encode())
Q4
What will be the output of the following Python code snippet? print('ab\ncd\nef'.splitlines())
Q5
Suppose x is 345.3546, what is format(x, "10.3f") (_ indicates space).
Q6
What will be the output of the following Python code? class tester: def __init__(self, id): self.id = str(id) id="224" >>>temp = tester(12) >>>print(temp.id)
Q7
What will be the output of the following Python code? print('abcdefcdgh'.partition('cd'))
Q8
What is the default value of encoding in encode()?
Q9
What will be the output of the following Python code? >>>print("D", end = ' ') >>>print("C", end = ' ') >>>print("B", end = ' ') >>>print("A", end = ' ')
Q10
What will be the output of the following Python code snippet? print('abef'.replace('cd', '12'))
Q11
What will be the output of the following Python code? print('xyyzxxyxyy'.lstrip('xyy'))
Q12
What will be the output of the following Python code snippet? print('11'.isnumeric())
Q13
What will be the output of the following Python code? print("abc. DEF".capitalize())
Q14
What will be the output of the following Python code? print('ab12'.isalnum())
Q15
What will be the output of the following Python code? print("Hello {0[0]} and {0[1]}".format(('foo', 'bin')))
Q16
What will be the output of the following Python code? print("xyyzxyzxzxyy".count('xyy', -10, -1))
Q17
What will be the output of the following Python code? print('Hello!2@#World'.istitle())
Q18
What will be the output of the following Python code snippet? print('{:$}'.format(1112223334))
Q19
What will be the output of the following Python code? print('*', "abcdef".center(7), '*', sep='')
Q20
What will be the output of the following Python code snippet? print('abef'.partition('cd'))
Q21
What will be the output of the following Python code? print("ccdcddcd".find("c"))
Q22
What will be the output of the following Python statement?(python 3.xx) >>>print(format("Welcome", "10s"), end = '#') >>>print(format(111, "4d"), end = '#') >>>print(format(924.656, "3.2f"))
Q23
What will be the output of the following Python code? print('cba'.maketrans('abc', '123'))
Q24
What will be the output of the following Python code snippet? print('HelloWorld'.istitle())
Q25
To check whether string s1 contains another string s2, use . . . . . . . .