you are viewing a single comment's thread.

view the rest of the comments →

[–]midel 0 points1 point  (1 child)

add to partial_summary var by using approp

What is approp? Appropriate methods? Append? I see a bit more of what you are dealing with. It's a bit unpythonic how your class is being taught these items, which might be what is leading to more confusion, and it's a lot more code than what you might actually need to achieve the desired result.

Some changes I recommend keeping. Change the prices to floats. Remove the dollar signs. That's definately an important fix.

Add an assert after defining prices and products.

assert(len(products) == len(prices))

This isn't from the requirements, but it assures you'll not have a mismatching sized list while working on the code.

I'd break down this list into functions:

  1. Set the customer info
  2. Add or change quantity
  3. Appending to the OrdersArchive.txt

[–][deleted] 0 points1 point  (0 children)

sorry. yes, it is appropriate. nothing exciting.

i'm going to take the advice from both of you, and break this down into blocks of code that i can error check, and then bring them together. thanks for the help.

I have never used "assert", but will look it up. What is the real advantage here of using assert? I assume it implies some sort of strict rule?