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
Answered by Kelvin C. Python tutor

1311 Views

See similar Python Mentoring tutors

Related Python Mentoring answers

All answers ▸

What can I do with Python?


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.


Write a recursive function that takes any integer n and prints the nth Fibonacci number.


What's the difference between a local and a global variable?


We're here to help

contact us iconContact usWhatsapp logoMessage us on Whatsapptelephone icon+44 (0) 203 773 6020
Facebook logoInstagram logoLinkedIn logo

© MyTutorWeb Ltd 2013–2025

Terms & Conditions|Privacy Policy
Cookie Preferences