Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from random import choice
- from string import ascii_uppercase
- from string import digits
- allowed_users=["ADMIN"]
- allowed_passwords=["admin"]
- wallet=1000
- a=5
- b=5
- c=5
- d=5
- e=5
- f=5
- g=5
- h=5
- i=5
- j=5
- z=0
- def create():
- global allowed_users
- global allowed_passwords
- m=raw_input("Enter new Username: ")
- n=raw_input("Enter new Password: ")
- allowed_users.append(m)
- allowed_passwords.append(n) # Function to create new account
- def login():
- global allowed_users
- global allowed_passwords
- l=0
- print "Please enter your Username and Password."
- while l==0:
- s=raw_input("\nUsername: ")
- d=raw_input("Password: ")
- if s in allowed_users and d in allowed_passwords:
- print "Thanks you for logging in. Your account balance is $1000.\n"
- l=100
- else:
- print "Incorrect Username and/or Password."
- continue # Logs in to store
- while z==0:
- print """
- Welcome User. Select a number to begin.
- 1) Create Account
- 2) Login
- """
- q=int(input(">"))
- if q==1:
- create()
- elif q==2:
- login()
- z=z+100
- else:
- print "Not an Option" # While loop for logging in
- def menu():
- print """
- Welcome User, to the Awesome Deluxe Computer Parts Shop. Select the Number to Begin.
- \t1) Browse Selections
- \t2) Leave Shop
- """ # Function for Main Menu
- def purchase():
- global wallet
- global a
- global b
- global c
- global d
- global e
- global f
- global g
- global h
- global i
- global j
- while wallet>0: #while loop for buying
- print """
- Here are the Selections we have currently. You have %d dollars left in your account.
- 1) EVGA GeForce GT 740 Superclocked Single Slot 4GB DDR3 Graphics Cards 04G-P4-2744-KR (%d)
- 2) Corsair Vengeance Pro 16GB 2x8GB DDR3 2400MHz PC3 19200 Desktop, Red CMY16GX3M2A2400C11R (%d)
- 3) Corsair Gaming M65 RGB FPS Gaming Mouse, Aircraft-Grade Aluminum, 8200 DPI (CH-9000109-NA) (%d)
- 4) Tree New Bee Cooling Pad for 15.6 - 17-Inch Laptops with Four 120mm Fans at 1200 RPM, Black (TNB-K0025) (%d)
- 5) WD Blue 1TB Desktop Hard Disk Drive - 7200 RPM SATA 6 Gb/s 64MB Cache 3.5 Inch - WD10EZEX (%d)
- 6) AULA LED Backlit Gaming Keyboard (3 Colorways) (%d)
- 7) AMD A10-5800K APU 3.8Ghz Processor AD580KWOHJBOX (%d)
- 8) NEC 55" LED 1920 x 1080 3500:1 Ultra-Narrow Bezel TileMatrix Video Wall Solution X554UNS-TMX9P (%d)
- 9) Crucial Ballistix Sport 8GB Kit (4GBx2) DDR3 1600 MT/s (PC3-12800) CL9 @1.5V UDIMM 240-Pin Memory BLS2K4G3D169DS1J (%d)
- 10) Nile Crocodile Lawyer's Bag (%d)
- 11) I do not want to buy anything right now.
- """ %(wallet,a,b,c,d,e,f,g,h,i,j)
- p=int(input("Choose the Number to see the Selection. "))
- if p==1: # if statements for buying items
- print """
- EVGA GeForce GT 740 Superclocked Single Slot 4GB DDR3 Graphics Cards 04G-P4-2744-KR (%d) by EVGA
- $98 (.07% tax + $11 S&H)
- """
- print "Are you sure you want to purchase this item for 98 dollars plus taxing and shipping costs?"
- t=raw_input(">")
- if t=="yes" or t=="Yes":
- r=int(input("How many do you want? "))
- price=98*r
- tax=price*.07
- final_price=price+tax+11
- trans=(''.join(choice(ascii_uppercase+digits) for i in range(9))) #Transaction ID
- if a>0 and wallet>final_price:
- a=a-r
- wallet=wallet-final_price
- print """
- Transaction ID: %s
- Total = $%d
- Thanks for shopping with Us. Your new balance is $%d.
- There are %d left of this item.
- """ %(trans,final_price, wallet, a)
- else:
- print "There is no more of this item and/or You don't have enough money. Going back to home."
- elif t=="no" or t=="No":
- print "Going Back to Menu"
- elif p==2:
- print """
- Corsair Vengeance Pro 16GB 2x8GB DDR3 2400MHz PC3 19200 Desktop, Red CMY16GX3M2A2400C11R
- $85 (.07% tax + $11 S&H)
- """
- print "Are you sure you want to purchase this item for 85 dollars plus taxing and shipping costs?"
- t=raw_input(">")
- if t=="yes" or t=="Yes":
- r=int(input("How many do you want? "))
- price=85*r
- tax=price*.07
- final_price=price+tax+11
- trans=(''.join(choice(ascii_uppercase+digits) for i in range(9)))
- if b>0 and wallet>final_price:
- b=b-r
- wallet=wallet-final_price
- print """
- Transaction ID: %s
- Total $%d
- Thanks for shopping with Us. Your new balance is $%d.
- There are %d left of this item.
- """ %(trans,final_price, wallet, b)
- else:
- print "There is no more of this item and/or You don't have enough money. Going back to home."
- elif t=="no" or t=="No":
- print "Going Back to Menu"
- elif p==3:
- print """
- Corsair Gaming M65 RGB FPS Gaming Mouse, Aircraft-Grade Aluminum, 8200 DPI (CH-9000109-NA)
- $60 (.07% tax + $11 S&H)
- """
- print "Are you sure you want to purchase this item for 60 dollars plus taxing and shipping costs?"
- t=raw_input(">")
- if t=="yes" or t=="Yes":
- r=int(input("How many do you want? "))
- price=60*r
- tax=price*.07
- final_price=price+tax+11
- trans=(''.join(choice(ascii_uppercase+digits) for i in range(9)))
- if c>0 and wallet>final_price:
- c=c-r
- wallet=wallet-final_price
- print """
- Transaction ID: %s
- Total: $%d
- Thanks for shopping with Us. Your new balance is $%d.
- There are %d left of this item.
- """ %(trans,final_price, wallet, c)
- else:
- print "There is no more of this item and/or You don't have enough money. Going back to home."
- elif t=="no" or t=="No":
- print "Going Back to Menu"
- elif p==4:
- print """
- Tree New Bee Cooling Pad for 15.6 - 17-Inch Laptops with Four 120mm Fans at 1200 RPM, Black (TNB-K0025)
- $23 (.07% tax + $11 S&H)
- """
- print "Are you sure you want to purchase this item for 23 dollars plus taxing and shipping costs?"
- t=raw_input(">")
- if t=="yes" or t=="Yes":
- r=int(input("How many do you want? "))
- price=23*r
- tax=price*.07
- final_price=price+tax+11
- trans=(''.join(choice(ascii_uppercase+digits) for i in range(9)))
- if d>0 and wallet>final_price:
- d=d-r
- wallet=wallet-final_price
- print """
- Transaction ID: %s
- Total: $%d
- Thanks for shopping with Us. Your new balance is $%d.
- There are %d left of this item.
- """ %(trans,final_price, wallet, d)
- else:
- print "There is no more of this item and/or You don't have enough money. Going back to home."
- elif t=="no" or t=="No":
- print "Going Back to Menu"
- elif p==5:
- print """
- WD Blue 1TB Desktop Hard Disk Drive - 7200 RPM SATA 6 Gb/s 64MB Cache 3.5 Inch - WD10EZEX
- $55 (.07% tax + $11 S&H)
- """
- print "Are you sure you want to purchase this item for 55 dollars plus taxing and shipping costs?"
- t=raw_input(">")
- if t=="yes" or t=="Yes":
- r=int(input("How many do you want? "))
- price=55*r
- tax=price*.07
- final_price=price+tax+11
- trans=(''.join(choice(ascii_uppercase+digits) for i in range(9)))
- if e>0 and wallet>final_price:
- e=e-r
- wallet=wallet-final_price
- print """
- Transaction ID: %s
- Total: $%d
- Thanks for shopping with Us. Your new balance is $%d.
- There are %d left of this item.
- """ %(trans,final_price, wallet, e)
- else:
- print "There is no more of this item and/or You don't have enough money. Going back to home."
- elif t=="no" or t=="No":
- print "Going Back to Menu"
- elif p==6:
- print """
- AULA LED Backlit Gaming Keyboard (3 Colorways)
- $20 (.07% tax + $11 S&H)
- """
- print "Are you sure you want to purchase this item for 20 dollars plus taxing and shipping costs?"
- t=raw_input(">")
- if t=="yes" or t=="Yes":
- r=int(input("How many do you want? "))
- price=20*r
- tax=price*.07
- final_price=price+tax+11
- trans=(''.join(choice(ascii_uppercase+digits) for i in range(9)))
- if f>0 and wallet>final_price:
- f=f-r
- wallet=wallet-final_price
- print """
- Transaction ID: %s
- Total: $%d
- Thanks for shopping with Us. Your new balance is $%d.
- There are %d left of this item.
- """ %(trans, final_price, wallet, f)
- else:
- print "There is no more of this item and/or You don't have enough money. Going back to home."
- elif t=="no" or t=="No":
- print "Going Back to Menu"
- elif p==7:
- print """
- AMD A10-5800K APU 3.8Ghz Processor AD580KWOHJBOX
- $125 (.07% tax + $11 S&H)
- """
- print "Are you sure you want to purchase this item for 125 dollars plus taxing and shipping costs?"
- t=raw_input(">")
- if t=="yes" or t=="Yes":
- r=int(input("How many do you want? "))
- price=125*r
- tax=price*.07
- final_price=price+tax+11
- trans=(''.join(choice(ascii_uppercase+digits) for i in range(9)))
- if g>0 and wallet>final_price:
- g=g-r
- wallet=wallet-final_price
- print """
- Transaction ID: %s
- Total: $%d
- Thanks for shopping with Us. Your new balance is $%d.
- There are %d left of this item.
- """ %(trans,final_price, wallet, g)
- else:
- print "There is no more of this item and/or You don't have enough money. Going back to home."
- elif t=="no" or t=="No":
- print "Going Back to Menu"
- elif p==8:
- print """
- NEC 55" LED 1920 x 1080 3500:1 Ultra-Narrow Bezel TileMatrix Video Wall Solution X554UNS-TMX9P
- $915 (.07% tax + $11 S&H)
- """
- print "Are you sure you want to purchase this item for 915 dollars plus taxing and shipping costs?"
- t=raw_input(">")
- if t=="yes" or t=="Yes":
- r=int(input("How many do you want? "))
- price=915*r
- tax=price*.07
- final_price=price+tax+11
- trans=(''.join(choice(ascii_uppercase+digits) for i in range(9)))
- if h>0 and wallet>final_price:
- h=h-r
- wallet=wallet-final_price
- print """
- Transaction ID: %s
- Total: $%d
- Thanks for shopping with Us. Your new balance is $%d.
- There are %d left of this item.
- """ %(trans,final_price, wallet, h)
- else:
- print "There is no more of this item and/or You don't have enough money. Going back to home."
- elif t=="no" or t=="No":
- print "Going Back to Menu"
- elif p==9:
- print """
- Crucial Ballistix Sport 8GB Kit (4GBx2) DDR3 1600 MT/s (PC3-12800) CL9 @1.5V UDIMM 240-Pin Memory BLS2K4G3D169DS1J
- $41 (.07% tax + $11 S&H)
- """
- print "Are you sure you want to purchase this item for 41 dollars plus taxing and shipping costs?"
- t=raw_input(">")
- if t=="yes" or t=="Yes":
- r=int(input("How many do you want? "))
- price=41*r
- tax=price*.07
- final_price=price+tax+11
- trans=(''.join(choice(ascii_uppercase+digits) for i in range(9)))
- if i>0 and wallet>final_price:
- i=i-r
- wallet=wallet-final_price
- print """
- Transaction ID: %s
- Total: $%d
- Thanks for shopping with Us. Your new balance is $%d.
- There are %d left of this item.
- """ %(trans,final_price, wallet, i)
- else:
- print "There is no more of this item and/or You don't have enough money. Going back to home."
- elif t=="no" or t=="No":
- print "Going Back to Menu"
- elif p==10:
- print """
- Nile Crocodile Lawyer's Bag
- $900 (.07% tax + $11 S&H)
- """
- print "Are you sure you want to purchase this item for 900 dollars plus taxing and shipping costs?"
- t=raw_input(">")
- if t=="yes" or t=="Yes":
- r=int(input("How many do you want? "))
- price=900*r
- tax=price*.07
- final_price=price+tax+11
- trans=(''.join(choice(ascii_uppercase+digits) for i in range(9)))
- if j>0 and wallet>final_price:
- j=j-r
- wallet=wallet-final_price
- print """
- Transaction ID: %s
- Total: $%d
- Thanks for shopping with Us. Your new balance is $%d.
- There are %d left of this item.
- """ %(trans,final_price, wallet, j)
- else:
- print "There is no more of this item and/or You don't have enough money. Going back to home."
- elif t=="no" or t=="No":
- print "Going Back to Menu"
- elif p==11:
- print "Ok then. Going back to Main Menu."
- break
- else:
- print "Not a number on the list." #Purchase Function
- while True:
- menu()
- t=int(input(">"))
- if t==1:
- purchase()
- elif t==2:
- print "Exiting Shop. Thank you for visting us, and We hope to see you again!!?!"
- break
- else:
- print "Not an option." # While loop for Main Menu
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement