If so, just indent the entire menu(self) block. More info hereĮDIT: Actually, if I understand your code, your menu(self) belongs to the CashRegister class. The self parameter is reserved for class methods. It seems as though def menu(self) is not inside any class, so it shouldn't have a self parameter. View item \n 3.Return to Main Menu ")))Ĭhoice=int(input(("Would you like to purchase this item? \n 1. ![]() Return(description(RetailItem), units(RetailItem), price(RetailItem))ĭef main(): C1=CashRegister(CashRegister)Ĭhoice=int(input(("Options: \n 1.Add to Cart 2. Print("You have added" (item) "to your cart") Self.totalprice = totalprice.append(item.price) Item = int(input("What would you like to select? ")) Print("Welcome to The Toy Store.\n Selection:\n 1.Duck \n 2.Bunny \n 3.Porcupine") scription = "Pink plush porcupine"īscription = "small white plush bunny" ![]() Code may not appear indented correctly here but that's more a copy and pasting error. I'm trying to make a store program on Python 3.6 and my code's not working.I made a lot of revisions, now I'm encountering more internal coding problems such as making the menu run in a loop until the customer exits the program and creating lists inside of lists with all of the information of the respective items.
0 Comments
Leave a Reply. |