# Created by PyCharm Pro Edition    
# User: Kaushik Talukdar                   
# Date: 23-04-17                           
# Time: 11:33 PM

# What if we want to increment the value of an attribute (instead of replacing it outright)

class Car():
    def __init__(self, make, model, year):
        self.make = make
        self.model = model
        self.year = year
        self.mileage = 0

    def get_descriptive_name(self):
        full_name = self.make.title() + ' ' + self.model.title() + ' ' + str(self.year)
        return full_name

    def read_odometer(self):
        if(self.mileage == 0):
            return "brand new"
        else:
            return "used"

# Here we are using 2 methods with the same argument. Won't there be collision? NO. The arguments are not the same
# Different methods can have arguments that have the same name. A person can have different names depending on location

##################################################

    def update_odometer(self, mileage):
        self.mileage = mileage

    def increase_odometer(self, mileage):
        self.mileage += mileage
        return self.mileage

    def get_odometer_readings(self):
        return self.mileage

##################################################

my_new_car = Car('Maruti', '800', '2002')
car_name = my_new_car.get_descriptive_name()

my_new_car.update_odometer(1000)

my_new_car.increase_odometer(200)

car_status = my_new_car.read_odometer()
print("I just bought a " + car_status + " car. " + car_name)

odometer_reading = my_new_car.get_odometer_readings()

if(my_new_car.get_odometer_readings()>0):
    print("It has ran " + str(odometer_reading) + "kms")