We're a community of 1076K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,075,973 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Used Vehicle classes

There are websites such as http://www.cars.com that provide information about secondhand vehicles. Design a base class for vehicle with fields such as model, year, total mileage, vehicle identification number (VIN), EPA class, EPA mileage, engine, transmission, and options.
Design subclasses for car, truck, SUV, and minivan. Think about the specific fields and methods required for the subclasses.

This what I got so far am I doing it right...

class UsedVehicle(object):

def __int__(self, model, year, total mileage, VIN\
            , EPA, EPA mileage, engine, transmission):
    self.model = model
    self.year = year
    self.total mileage = total mileage
    self.VIN = VIN
    self.EPA = EPA
    self.EPA mileage = EPA mileage
    self.engine = engine
    self.transmission = transmission

def __repr__(model):

    return self.model()

def __repr__(year):

    return self.year()
2
Contributors
1
Reply
22 Hours
Discussion Span
5 Months Ago
Last Updated
2
Views
jecelone
Newbie Poster
1 post since Dec 2012
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0
pyTony
pyMod
Moderator
6,305 posts since Apr 2010
Reputation Points: 879
Solved Threads: 986
Skill Endorsements: 26

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page rendered in 0.0748 seconds using 2.71MB