Logo

Python Questions Set 54:

Quiz Mode

Does Python support multiple inheritance ?


1
2
3

Solution:

 Which of the following cannot be a variable? 

1
2
3
4

Solution:

What will be the output of the following Python code snippet?

X = "hi"
print("05d" % X)

1
2
3
4

Solution:

 

What Is The Output Of The Following Code Snippet?

min = (lambda x, y: x if x < y else y)
print(min(101*99, 102*98))

1
2
3
4

Solution:

What will be the output of the following Python code?

a = {3, 4, 5}
b = {5, 6, 7}
print(a | b)

1
2
3
4

Solution:

 

What will be the output of the following Python code?

  1. >>>my_tuple = (1, 2, 3, 4)
  2. >>>my_tuple.append( (5, 6, 7) )
  3. >>>print len(my_tuple)

1
2
3
4

Solution:

 

The output of the following two Python codes is exactly the same.



object
'a'
CODE 1
>>> pickle.dumps('a', 3)
CODE 2
>>> pickle.dumps(object, 3)

1
2

Solution:

 Which of the following functions can help us to find the version of python that we are currently working on? 

1
2
3
4

Solution:

Guess who am I? 


Used when you need some block of code syntactically, but you want to skip its execution. This is basically a null operation. Nothing happens when this is executed. 

1
2
3

Solution:

What will be the output of the following Python code snippet?

z=set('abc')
z.add('san')
z.update(set(['p', 'q']))
z

1
2
3
4

Solution: