Meet Travis - Your AI-Powered tutor

Learn more about methods python with these recommended learning resources

Magic Methods in Python, by example

 Towards Data Science

Magic methods are special methods that you can define to add ‘magic’ to your classes. They are always surrounded by double underscores, for example, the __init__ and __str__ magic methods. Magic…

Read more at Towards Data Science

Python Programming Tricks

 Python in Plain English

Collections are a Python module which implements specialised containers. Collections in itself are a huge topic so, I will divide this into three articles but everything which I have mentioned below…

Read more at Python in Plain English

Method types in python

 Level Up Coding

Have you ever wondered why in python some methods receive as a parameter the self keyword, others the cls, and others just nothing? In order to understand these keywords and why python asks the…

Read more at Level Up Coding

“Magic Methods” in Python Program

 Python in Plain English

Photo by Mahesh Ranaweera on Unsplash In Python, magic methods, also known as special methods or dunder (double underscore) methods, provide a way to define and customize the behavior of classes. Thes...

Read more at Python in Plain English

List Methods in Python

 Python in Plain English

A list is an ordered sequence of items. List elements can be of any type such as strings or numbers while arrays do not allow this. Sequences are of specific type and size so this is the difference…

Read more at Python in Plain English

Using Magic Methods in Python

 Towards Data Science

They’re everything in object-oriented Python. They’re special methods that you can define to add “magic” to your classes. They’re always surrounded by double underscores, for example__init__. They're…...

Read more at Towards Data Science

Python List Methods

 Towards Data Science

In Python, a list is a collection of pieces of data. A list is surrounded by square brackets [ ] with each item separated by a comma ( , ), and can contain anywhere from zero to infinity items (or…

Read more at Towards Data Science

The Pythonic Way

 Python in Plain English

Point class in Python Commenting is boring. Documenting is time-wasting. Test2 is a good name for a class. a_final is a good name for a variable. I don’t need to write tests, that function is not so i...

Read more at Python in Plain English

Python Functions

 Analytics Vidhya

Functions are a way to organize code blocks for re-usability. We’ll discuss two ways of creating functions in Python: using the def statement and the lambda statement

Read more at Analytics Vidhya

Object-oriented programming: Special methods in Python

 Level Up Coding

Special methods allow us to use some built-in operations in Python with our own custom created objects. Suppose we have a list and we want to check the length of the list and also print the list, we…

Read more at Level Up Coding

Types of Methods in Python Classes

 Python in Plain English

Instance attributes are those attributes that are not shared by objects. Every object has its own copy of the instance attribute, let us see an example It is one of the rarely used methods, where we…

Read more at Python in Plain English

Methods

 Python Like You Mean It

methods by surveying a number of these special methods they will greatly bolster our ability to define convenient, user-friendly classes. Instance Methods  An instance method is defined whenever a fu...

Read more at Python Like You Mean It

Method Chaining in Python

 Python in Plain English

Approach to Efficient Data Analyses Photo by D koi on Unsplash In my years of experience working as an analyst, I have often seen Python’s powerful capabilities leveraged to enhance efficiency in dat...

Read more at Python in Plain English

Python Magic Methods You Haven’t Heard About

 Towards Data Science

There are many Python magic methods you probably never knew existed — let’s find out what they do and how we can use them in our code Continue reading on Towards Data Science

Read more at Towards Data Science

5 Python Techniques That Will Amaze You

 Python in Plain English

Top techniques that you should know as a Python developer Continue reading on Python in Plain English

Read more at Python in Plain English

Functions in Python

 Python in Plain English

Python for Beginners Series — Part 14 Continue reading on Python in Plain English

Read more at Python in Plain English

5 Pairs of Magic Methods in Python You Should Know

 Better Programming

When it comes to naming functions in Python, we can use underscores as well as letters and numbers. When underscores are used between words, they don’t mean much — they just help readability by…

Read more at Better Programming

4 Must-Know Special Methods for Python

 Towards Data Science

Everything in Python is an object and we define objects through classes. When we define an object, we actually create an instance of a class. Thus, class is the most fundamental piece in Python. We…

Read more at Towards Data Science

Learning Python: Classes and Methods

 Level Up Coding

In my last article, I introduced Python classes by demonstrating how to create class objects. I showed how to add attributes to an object once the object is instantiated, but I didn’t demonstrate how…...

Read more at Level Up Coding

How to Use Methods That You Have Not Implemented Yet in Python

 Python in Plain English

A guide on using methods that you haven’t yet implemented in Python Continue reading on Python in Plain English

Read more at Python in Plain English

Techniques to Write Better Python Code

 Machine Learning Mastery

Last Updated on June 7, 2022 We write a program to solve a problem or make a tool that we can repeatedly solve a similar problem. For the latter, it is inevitable that we come back to revisit the prog...

Read more at Machine Learning Mastery

Advanced Python Programming: Part 2

 Python in Plain English

Photo by Mohammad Rahmani on Unsplash We will be continuing with our series to learn advanced programming in Python, this is the second part of the series, if you haven't read the first part yet, plea...

Read more at Python in Plain English

Everything About Methods & Classes in Python

 Python in Plain English

In this article, I am going to explain the concept of Objects and Classes in Python. Why Object Oriented Programming (OOP)? OOP allows programmers to create objects with methods and classes. All these...

Read more at Python in Plain English

The Fundamentals of Python

 Python in Plain English

We all know that Python is a very popular programming language in recent days. It is loved for its easy-to-learn commands, large use cases, and the availability of a large number of modules. The…

Read more at Python in Plain English