THIS Makes Your Python Classes More READABLE

Amir Ali Hashemi
1 min readJul 20, 2023

Here is one quick tip that you can use with Python classes

In this example, we have a class called Fruit and we will initialize it with the name and the cost of the fruit. And it contains two methods:

class Fruit:
def __init__(self, name, cost):
self.name = name
self.cost = cost

def meth1(self):
pass

def meth2(self):
pass

--

--

Amir Ali Hashemi

I'm an AI student who attempts to find simple explanations for questions and share them with others