x=6
x++
In which direction is the turtle pointed by default?
The output of the function len("abc") and sys.getsize("abc") will be same?
Which of the following expressions will evaluate to True?
What does math.sqrt(X) do?
Is the following Python code correct?
>>> class A:
def __init__(self, b):
self.b = b
def display(self):
print(self.b)
>>> obj = A("Hello")
>>> del obj
What is the output of the following code?
def foo(i, x=[]):
x.append(i)
return x
for i in range(3):
print(foo(i))
What will be the output of the following Python code?
myList = [1, 5, 5, 5, 5, 1]
max = myList[0]
indexOfMax = 0
for i in range(1, len(myList)):
if myList[i] > max:
max = myList[i]
indexOfMax = i
>>>print(indexOfMax)
What will be the output of the following Python code?
>>> class demo():
def __repr__(self):
return '__repr__ built-in function called'
def __str__(self):
return '__str__ built-in function called'
>>> s=demo()
>>> s
What will be the output of the following Python code?
class A:
def test(self):
print("test of A called")
class B(A):
def test(self):
print("test of B called")
super().test()
class C(A):
def test(self):
print("test of C called")
super().test()
class D(B,C):
def test2(self):
print("test of D called")
obj=D()
obj.test()