For Code:
class Car(object):
def __init__(self, make, model, year, color, engine_type):
self.make = make
self.model = model
self.year = year
self.color = color
self.engine_type = engine_type
main():
car1 = Car('Ford', 'Mustang', '2001', 'Red')
print car1.make, car1.model, car1.year, car1.color
Is there a better/shorter way to print multiple variables (but not all of them such as using vars() or __dict__) from a class? Something like...
print car1.[make, model, year, color]
but that actually works?
print car1.make, car1.model, car1.year, car1.colorpprint.pprintorgetattr.