Skip to content

Latest commit

 

History

History
11 lines (6 loc) · 920 Bytes

method.md

File metadata and controls

11 lines (6 loc) · 920 Bytes

Method

A method in Python is similar to a function, in that it allows us to do things with data. However, a method is attached to what we call an object, which is a representation of data. Accordingly, a method operates as a function that is specifically available for that object.

Methods are accessed through the dot syntax .. For example, the method lower() can be attached to a string object like so: "HELLO".lower() and will return the string 'hello'.

Readings