What will be the output of the Python code above?
Anonymous Quiz
63%
[0]
16%
[1]
13%
[1, 0]
7%
[0, 1]
What will be the output of the code above?
Anonymous Quiz
7%
abc def
58%
ABC DEF
17%
Abc def
19%
Abc Def
π1
Code snippet:
class A:
@staticmethod
def a(x):
print(x)
A.a(100)
What will be the output of the code snippet?
Anonymous Quiz
14%
Error
15%
Warning
58%
100
13%
No output
What will be the output of the code snippet?
Anonymous Quiz
30%
0 1 2 3
5%
0 1 2 2
2%
3 3 3 3
43%
0 0 0 0
20%
error
Code snippet:
class Demo:
def __init__(self):
self.a = 1
self.__b = 1
def display(self):
return self.__b
obj = Demo()
print(obj.__b)
What will be the output of the code?
Anonymous Quiz
14%
The program has an error because there isnβt any function to return self.a
22%
The program has an error because b is private and display(self) is returning a private member
24%
The program has an error because b is private and hence canβt be printed
39%
The program runs fine and 1 is printed
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()