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 ▸

h


Write a simple Python program that asks a user to input their age and name and then return the text: "Hi my name is *NAME*, and I am *AGE* years old."


Create a program that generates prime numbers between two integer boundareis


Create an rock, paper, scissors game. The user should input one option, and the computer should play randomly.