METHODS
V VIDYASHANKAR
18 th JULY 2025
METHODS AND FUNCTIONS
◦ In Python, a method is a function that belongs to a class or an object
◦ Functions are standalone blocks of code that can be called independently,
methods are intrinsically linked to the data and behavior defined within a class
◦ Methods are used to define the actions or operations that objects of a class can
perform allowing objects to interact with their own data and with other objects
◦ Methods provide access to an object’s attributes, ensuring data integrity and
consistency
◦ Methods encapsulate specific pieces of logic related to the object’s functionality
Examples
◦ The variable name refers to the lower case string and the method title()
appears after the variable in the print() call.
Examples
Examples
Libraries