I have some code which seems to print [<__main__.TCar object at 0x0245C1B0>]
but I want it to print the actual contents of the list.
class TCar():
def __init__(self, Make, Model, EngineSize, Price):
self.Make = str(Make)
self.Model = str(Model)
self.EngineSize = float(EngineSize)
self.Price = float(Price)
Garage = []
for i in range(5):
Make = input("Please enter the make of the car: ")
Model = input("Please enter the model of the car: ")
EngineSize = input("Please enter the engine size of the car: ")
Price = input("Please enter the price of the car: ")
Garage.append(TCar(Make, Model, EngineSize, Price))
print(Garage)
What is wrong with my code?