QUESTION 3 OF 10

What is the purpose of __init__ in Python?

Reveal the answer and explore the explanation.

03
EasyCore

What is the purpose of __init__ in Python?

Answer
Answer

It initializes an already-created instance. Object creation is handled by __new__.

Practical example

Store model configuration when creating an inference service.

Reference: Further reading ↗

Last 30 min revisionHigh-yield interview Q&As