Constructors in Python objects: the __init__ method

Опубликовано: 17 Октябрь 2023
на канале: PatchyPython
34
1

A constructor is a special method that is called whenever an instance of a class is created. It ensures that the new object is properly initialised. The name of the constructor is always "__init__"; its task is to initialise the object, which generally involves assigning an initial value to all of its attributes. Check out the notebooks linked below for more information on OOP in Python.

Embedded video, part of the following courses:
Computer Programming at Queen Mary, University of London
Jupyter notebook: https://tinyurl.com/yc7u9fsc
Coding for Scientists at Queen Mary, University of London
Jupyter notebook: https://tinyurl.com/4yhnhjn6

Notebooks will open on Google Colab - no installation required


Смотрите видео Constructors in Python objects: the __init__ method онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь PatchyPython 17 Октябрь 2023, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 34 раз и оно понравилось 1 людям.