class car():
def __init__(self,name,model,colour,pricerange,state):
self.name = name
self.model = model
self.colour = colour
self.pricerange = pricerange
self.state = state
def fthree(self):
print("Name: "+self.name)
print("Model: " + str(self.model))
print("Colour: " + self.colour)
Output:
Name: tiago
Model: 2016
Colour: white
I am not using '\n'
. But the control is being shifted to the next line in the output. Does this always happen when working with a class in Python?