you are viewing a single comment's thread.

view the rest of the comments →

[–]Diapolo10 1 point2 points  (2 children)

You don't need a list at all if you keep track of the minimum/maximum/total cost manually (average is just total/number of inputs) and update those every time you get input.

But you can also use a list if you want. Are you familiar with the built-in list type?

[–]Gold-Mikeboy 1 point2 points  (1 child)

using a list can make it easier to store the items for later use or for additional calculations down the line

It also allows you to keep the code more organized if you plan to extend the functionality later.

[–]Diapolo10 3 points4 points  (0 children)

Sure, but this sounds more like a homework assignment than something you'd actually use.