Logo

Python Questions Set 160:

Quiz Mode

>>> a = 5

>>> b = 10

>>> print((a & b) | b)

1
2
3
4

Solution:

Find the output of the following code.

a=min([sum([22,round(5.497)]),max(abs(-24),2)])

Solution:

What will be the output of the following Python code?

print(type(type(int)))

1
2
3
4

Solution:

 

Which Of The Following Keywords Mark The Beginning Of The Class Definition?

1
2
3
4

Solution:

What is the output of the following Python program?

y = 8
z = lambda x: x * y
print(z(6))

1
2
3
4

Solution:

l1 = [1,2,3,4]

l2 = [5,6,7,8]

l3 = l1.extends(l2)

print(l3)

1
2
3
4

Solution:

 

What will be the output of the following Python code?

num = ['One', 'Two', 'Three']
for i, x in enumerate(num):
   print('{}: {}'.format(i, x),end=" ")

1
2

Solution:

  What is the current syntax of rename() a file? 

1
2
3
4

Solution:

Which is the most appropriate definition for recursion? 

1
2
3
4

Solution:

 

Which Of The Following Statements Are Correct About The Given Code Snippet?

class A:
   def __init__(self, i = 0):
       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()

1
2
3
4

Solution: