Which function is ran when an object is instantiated?

The function is called init. This is the constructor, which is used to initiate the attributes of the object and allows arguments to be passed upon instantiation.

KC

Related Python Mentoring answers

All answers ▸

Demonstrate a recursive solution to calculate the factorial of a number


h


Generate an array of integers from 0 to 99 and split it into two smaller arrays. Each smaller array will contain half of the original.


What is the outcome of the following code? print(2*[3,4,5])