Logo

Python Questions Set 19:

Quiz Mode

 Which function overloads the + operator? 

1
2
3
4

Solution:

 What type of data is: arr = [(1,1),(2,2),(3,3)]? 

1
2
3
4

Solution:

 

What Will Be The Output Of The Following?

s = "\t\tWelcome\n"
print(s.strip())

1
2
3
4

Solution:

What will be the output of the following Python code?

x = 'abcd'
for i in x:
print(i.upper())

1
2
3
4

Solution:

What will be the output of the following Python code?

True = False
while True:
   print(True)
   break

1
2
3
4

Solution:

>>> # dates are easily constructed and formatted
>>> from datetime import date
>>> now = date.today()
>>> now

1
2

Solution:

What is the purpose of the setattr() function in Python?

1
2
3
4

Solution:

Volume? of tesseract is?

def f(x, y):

    return x ** y


x = int (raw_input ("length-"))

z = f (x, 4)

print "volume? of the tesseract is %s cm? " % (z)

//length of the tesseract is 3cm

Solution:

What will be the output of the following code?

class Pencil:
def __init__(self,count):
self.count=count
print(self.count)
class Natraj(Pencil):
def __init__(self,count):
self.count=count
print(self.count)
super().__init__(10)
nt1=Natraj(2)

1
2
3
4

Solution:

 

Which Of The Following Function Definition Does Not Return Any Value?

1
2
3
4

Solution: