class Car:
def __init__(self):
self.colour="Golden"
self.weight=140
self.price=1500000
self.mileage=50
self.condition="Good"
def damage(self):
self.mileage=35
self.condition="Bad"
Car1=Car()
print(Car1.mileage)
print(Car1.condition)
Car1.damage()
print(Car1.mileage)
print(Car1.condition)
The output as executed by me is as follows:
You can run this python code online here.