Correct Answer: It must also define __hash__() if its instances are immutable and need to be hashable.
Explanation:
Note: This Question is unanswered, help us to find answer for this one
Python Skill Assessment
Your Skill Level: Poor
Retake Quizzes to improve it
More Python MCQ Questions
What expression evaluates to 'python 2.7'?
All Warnings in Python are subclassed from:
Which is a module in the Python Standard Library?
There are two strings, 'a' and 'b' with same values ,a='harmeet' and b='harmeet'. Which one of the following case is true?
Which of these functions would be used to display the internals of an object instance
Output of the following code? def name(X, Y, Z, **opt): if opt.get('number') == 'Y': return Y res = name(1, 2, 3, action = 'sum', number = 'Y') print 'Result: %d' % res
What gets printed in the code below ? def f(x, l=[]): for i in range(x): l.append(i * i) return l f(2) f(3, [3, 2, 1]) print f(3)
Which will be the output of the below code snippet? class foo: def normal_call(self): print('normal_call') def call(self): print('first_call') self.call = self.normal_call y = foo() y.call() y.call() y.call()
Consider the following Python code: test = 1/2 What is the value of 'test' in Python 2.7 and 3.5, respectively ?
Which is the correct way to determine a variable's type in Python?