Logo

Python Questions Set 31:

Quiz Mode

 What is the value of the expression: 

 

~100?

Solution:

What is the output of the following code?


print(False < True)

1
2
3

Solution:

 

What Relationship Is Best Suited For House And Door?

1
2
3

Solution:

Which of the following functions will return the symmetric difference between two sets, x and y? 

1
2
3
4

Solution:

Predict the output of the following code:


print("hi" " how" " are" " you?")

1
2
3
4

Solution:

 

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

a = [0, 1, 2, 3]
for a[-1] in a:
   print(a[-1])

1
2
3
4

Solution:

What is the purpose of the exec() method of the QApplication class?

1
2
3
4

Solution:

 

What will be the output of the following Python code?

b=[2,3,4,5]
a=list(filter(lambda x:x%2,b))
print(a)

1
2

Solution:

 Suppose B is a subclass of A, to invoke the __init__ method in A from B, what is the line of code you should write? 

1
2
3
4

Solution:

Which of the following statements about strings in Python is incorrect?

1
2
3
4

Solution: