Isheeta S
0
Q:

__str___ method python

class Car:
    def __init__(self, color, mileage):
        self.color = color
        self.mileage = mileage

    def __str__(self):
        return 'a {self.color} car'.format(self=self)
0

New to Communities?

Join the community