A Hundred Days of Code, Day 003 - Methods
Learnt about methods today. Notes follow … My understanding about methods? They are functions in classes that help me manipulate the data the objects contain when they are created. I have been using something them subconsciously all along. The __init__ method, that is called/run automatically every time an object is created. Aha A nice way to unpack the .notation i use Let’s say I have a class SquareNumbers that has a function (method) — x2 — that will, you know, square a number. And then I create an object f with a number and call the square method on it. ...