Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- """Now i no longer edit this script as this is now a legacy and advanced version of the same program is released... check my paste bin account for newer version of this program"""
- import sys
- class grocery:
- def input(self):
- choice=0
- a=[]
- b=[]
- while choice!=5:
- print("\n\n1.Insert Grocery\n2.Display Bucket List\n3.Total Bill\n4.Remove item\n5.Exit Store")
- choice=int(input("\nEnter Choice:"))
- if choice==1:
- print("Name of Item:")
- nome = input()
- a.append(nome)
- print("Rate of Item:")
- rate = int(input())
- b.append(rate)
- elif choice==2:
- if a == []:
- print("Your Bucket List is empty! Insert Item")
- else:
- for i in range(0, len(a)):
- print("{},{}/-".format(a[i], b[i]))
- elif choice==3:
- bill = 0
- for i in b:
- bill += i
- print("Your Bill is :", bill,"/-")
- elif choice==4:
- if a == []:
- print("Your Bucket List is empty! Insert Item")
- else:
- itm = ""
- print("Enter Item to be Deleted:")
- itm = input()
- if itm in a:
- index = a.index(itm)
- a.remove(itm)
- b.remove(b[index])
- print("Bucket List Updated")
- else:
- print("Given item not present in Bucket List")
- elif choice==5:
- print("Program Terminated5")
- sys.exit()
- else:
- print("Try Again")
- obj=grocery()
- obj.input()
Add Comment
Please, Sign In to add comment