1
Guys, I created this class (Car class), then defined the values for each argument of this class. Only when printing the variable with the values already defined, this appears:
#isso é o que aparece ao imprimir a variável car1
<Car object at 0x7fa71d52fb10>
class Car(object):
condition = "new"
def __init__(self, model, color, mpg):
self.model = model
self.color = color
self.mpg = mpg
def display_car(self):
print("This is a %s %s with %s MPG." % (self.color, self.model, str(self.mpg))
def drive_car(self):
self.condition = "used"
car1 = Car('Monza', 'marron', 55)
print(car1)#É ESSA variável que, ao ser imprimida, imprime aquele valor estranho.
only on the level of curiosity, I would like to know why this behavior.
NOTE:Remembering that I am a self-taught student in programming, so have a little more patience, ok?
Thanks in advance for the collaboration of you guys!
your reply was SEN-SA-CIONAL, very clear and objective, thank you very much! , congratulations!!!
– Eduardo
Thanks Eduardo , if you need us we are there :D
– Otávio Reis Perkles