What will be the value of X in the Python expression above?
Anonymous Quiz
11%
30.0
22%
30.8
14%
28.4
52%
27.2
Code snippet:
re.split(r'(a)(t)', 'Maths is a difficult subject')
What will be the output of the code above?
Anonymous Quiz
16%
[βM a t h s i s a d i f f i c u l t s u b j e c tβ]
23%
[βMathsβ, βisβ, βaβ, βdifficultβ, βsubjectβ]
20%
βMaths is a difficult subjectβ
41%
[βMβ, βaβ, βtβ, βhs is a difficult subjectβ]
What is the output of print 0.1 + 0.2 == 0.3?
Anonymous Quiz
56%
True
26%
False
11%
Machine dependent
7%
Error
Code snippet:
aTuple = (100, 200, 300, 400, 500)
aTuple[1] = 800
print(aTuple)
What is the output of the code?
Anonymous Quiz
48%
TypeError
43%
(100, 800, 200, 300, 400, 500)
9%
(800, 100, 200, 300, 400, 500)
π1
Code snippet:
class A:
def __init__(self, i=100):
self.i=i
class B(A):
def __init__(self,j=0):
self.j=j
def main():
b= B()
print(b.i)
print(b.j)
main()
What is the ouput for the code?
Anonymous Quiz
34%
[βhatβ,βmatβ,βratβ,βrhymeβ]
25%
βhatmatratrhymeβ
18%
[βhat mat rat rhymeβ]
23%
βhatrhymematrhyme ratβ
Code snippet:
class Count:
def __init__(self, count=0):
self.__count=count
a=Count(2)
b=Count(2)
print(id(a)==id(b), end = '' '')
c= ''hello''
d= ''hello''
print(id(c)==id(d))
What is output of the code above?
Anonymous Quiz
22%
True False
34%
False True
18%
False False
26%
True True
Code snippet:
first = bool('False')
second = bool()
print(str(first) + " " + str(second))What will be the output of the Python code snippet?
Anonymous Quiz
17%
True True
29%
False True
32%
True False
22%
False False
Code snippet:
x = 'abcd'
for i in range(len(x)):
x[i].upper()
print (x)
What is the output of the code snippet above?
Anonymous Quiz
26%
abcd
59%
ABCD
10%
error
6%
none of the mentioned
π1
Code snippet:
D = dict()
for x in enumerate(range(2)):
D[x[0]] = x[1]
D[x[1]+7] = x[0]
print(D)
What is the output of the code?
Anonymous Quiz
21%
{0: 1, 7: 0, 1: 1, 8: 0}
21%
{1: 1, 7: 2, 0: 1, 8: 1}
33%
{0: 0, 7: 0, 1: 1, 8: 1}
25%
KeyError
Code snippet:
class A():
def disp(self):
print("A disp()")
class B(A):
pass
obj = B()
obj.disp()