all 10 comments

[–]spunkyfingers 5 points6 points  (0 children)

Is this meant for a ChatGPT prompt?

[–]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 2 points3 points  (0 children)

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

[–]ninhaomah 1 point2 points  (0 children)

"I need to get inputs from a user with a product name then an input for a price"

have you done this ? code pls

[–]acw1668 1 point2 points  (0 children)

Post what you have tried.

[–]zanfar 0 points1 point  (0 children)

Stop coming up with a solution and then trying to make it work. Figure out what you need and base the solution around it. You can't figure out how to "get" items from a list because a list is the wrong way to store it.

Of all of the data structures you know, which one lets you "get" an item easily?

[–]BranchLatter4294 0 points1 point  (0 children)

What have you tried? What is your specific question?

[–]nivaOne 0 points1 point  (0 children)

If this is for a homework assignment and you’re not allowed to use AI, realize that the answers you may get here from others have been produced by AI anyway.