Python Forum
Shopping cart program
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Shopping cart program
#7
(Jun-27-2022, 03:50 AM)Tofuboi03 Wrote: we had to have 5 options

Why then, in your first post, do you only have the 4 options?

Output:
Please type in one of these 1. Add item 2. View cart 3. Remove Item 4 compute total
The No1 thing about ANY project, is to be clear about the objective from the get-go.

Not a worry; we'll put that down to an error on your part.

What have you done over the weekend. Did you make any progress?

So, what you need to do (based on what you've done so far, I know you can do this) is...
  • Clean up your code
    • Correct the Menu: Option 4 needs attention and Option 5 needs to be added.
    • Remember that the 'input()' function returns a string object by default. Your Menu is doing on-the-fly type conversions (str -> int). No need.
    • Your script crashes with no input at the Menu. This needs to be corrected and is an easy fix.
    • Right now you have unused lists defined and will most likely never need them: don't define any objects that you don't use, rather add them as and when there is a use case. You need only two Lists which is easy to manage and keep synchronized.

Right now, I'm not too sure if your heart is in this. If you want to learn, take pride in your work and pay attention to detail. If you make the effort, then others will pay you back in kind, whereas if you don't then you'll be on your own.

You've made a start, but you've also made some sloppy mistakes. Make the corrections and show some interest and we can get this done in no time: I'll help you, if you help yourself.
Sig:
>>> import this

The UNIX philosophy: "Do one thing, and do it well."

"The danger of computers becoming like humans is not as great as the danger of humans becoming like computers." :~ Konrad Zuse

"Everything should be made as simple as possible, but not simpler." :~ Albert Einstein
Reply


Messages In This Thread
Shopping cart program - by Tofuboi03 - Jun-26-2022, 06:12 AM
RE: Shopping cart program - by rob101 - Jun-26-2022, 07:36 AM
RE: Shopping cart program - by rob101 - Jun-26-2022, 11:29 PM
RE: Shopping cart program - by Tofuboi03 - Jun-27-2022, 03:50 AM
RE: Shopping cart program - by BashBedlam - Jun-26-2022, 11:58 PM
RE: Shopping cart program - by Tofuboi03 - Jun-27-2022, 03:43 AM
RE: Shopping cart program - by rob101 - Jun-27-2022, 07:53 AM
RE: Shopping cart program - by shoesinquiry - Sep-07-2023, 09:41 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  project shopping cart pkmnmewtwo 1 3,382 May-03-2020, 10:46 PM
Last Post: pkmnmewtwo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020