Python help with storing values.?

## What I am trying to do is to get 3 sets of inputs and output them all using a class and __str__ method. I've tried multiple attempts and I know there are easier ways to do it but my teacher wanted us to use this method. I have the code to input and output close to what I want, but can't get it to store 3... show more ## What I am trying to do is to get 3 sets of inputs and output them all using a class and __str__ method. I've tried multiple attempts and I know there are easier ways to do it but my teacher wanted us to use this method. I have the code to input and output close to what I want, but can't get it to store 3 values. Is there anyway to do this using this method? thank you for any help or advice. ##

class RetailItem(object):

....def __init__(self,description, unit, cost):
........self.description = description
.........self.unit = unit
........self.cost = cost

....def __str__(self):
........ return "Description: " + self.description+" Units: "+ str(self.unit) +" Cost: "+str(self.cost)

if __name__ == "__main__":
.... for i in range(3):
........ description = input("Item name: ")
........unit = int(input("Number of units: "))
........cost = float(input("Price: "))
........retailItem1 = RetailItem(description,unit,cost)


print()
2 answers 2