Login to manage your account

Please enter a valid email address.
Forgot Password?
Please enter a valid password.
OR

Don't have an account yet? Sign up

Which method is called when an object is created and initialised?

  1. A __new__ then __init__
  2. B __init__ only
  3. C __call__
  4. D __create__
Answer

__new__ then __init__

__new__ allocates the instance and __init__ initialises it. Overriding __new__ is rarely needed outside immutable types and singletons.

All Python MCQs

Login to manage your account

Please enter a valid email address.
Forgot Password?
Please enter a valid password.
OR

Don't have an account yet? Sign up as