Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- import string
- print "Welcome to J's Electronics \nPlease Login Below "
- while True:#welcoms the user
- username = raw_input('Username:')
- print "Welcome to our shop",username.upper()
- break
- while True:
- password = raw_input('Password:')
- print "You are successfully logged in"
- break
- print "1)Browse our New Products 2)Logout"
- answer=True#aska what the user wants to do
- while answer:
- question = int(input("What would you like to do?"))
- if question == 1:
- break
- elif question ==2:
- print("Have a nice day ")
- exit()
- def items():#prints the list
- print"""
- Hello User. Your current account balance is .. $1000 dollars
- Top selling Items
- 1) Microsoft - Natural Ergonomic Keyboard 4000
- 2) Logitech - M325 Wireless Optical Mouse
- 3) Dell - SE2717HR 27" IPS LED FHD FreeSync Monitor
- 4) Asus - ROG STRIX H270F GAMING USB 3.1 Intel Motherboard
- 5) Intel® - Core™ i3-6100 3.7GHz Processor
- 6) PNY - XLR8 NVIDIA GeForce GTX 1050 Ti 4GB GDDR5 PCI Express 3.0 Graphics Card
- 7) Targus - Dual Fan Chill Mat Cooling System
- 8) CORSAIR - Carbide Series ATX Mid-Tower Case
- 9) WD - My Passport 2TB External USB 3.0 Portable Hard Drive
- 10) Office 365 Home, 1-year subscription, 5 PCs/Macs (Product Key Card)
- """
- items()
- items_for_sale=['Microsoft - Natural Ergonomic Keyboard 4000','Logitech - M325 Wireless Optical Mouse ','Dell - SE2717HR 27" IPS LED FHD FreeSync Monitor','Asus - ROG STRIX H270F GAMING USB 3.1 Intel Motherboard','Intel® - Core™ i3-6100 3.7GHz Processor','PNY - XLR8 NVIDIA GeForce GTX 1050 Ti 4GB GDDR5 PCI Express 3.0 Graphics Card ','Targus - Dual Fan Chill Mat Cooling System','CORSAIR - Carbide Series ATX Mid-Tower Case','WD - My Passport 2TB External USB 3.0 Portable Hard Drive','Office 365 Home, 1-year subscription, 5 PCs/Macs (Product Key Card)']
- credit=1000
- while True:
- items_for_sale=['Microsoft - Natural Ergonomic Keyboard 4000','Logitech - M325 Wireless Optical Mouse ','Dell - SE2717HR 27" IPS LED FHD FreeSync Monitor','Asus - ROG STRIX H270F GAMING USB 3.1 Intel Motherboard','Intel® - Core™ i3-6100 3.7GHz Processor','PNY - XLR8 NVIDIA GeForce GTX 1050 Ti 4GB GDDR5 PCI Express 3.0 Graphics Card ','Targus - Dual Fan Chill Mat Cooling System','CORSAIR - Carbide Series ATX Mid-Tower Case','WD - My Passport 2TB External USB 3.0 Portable Hard Drive','Office 365 Home, 1-year subscription, 5 PCs/Macs (Product Key Card)']
- userInput = int(raw_input("Enter Item Number:"))
- if userInput == 1:
- print items_for_sale[0]
- print "You have", credit-10, "left"
- print "Transaction ID:",''.join([random.choice(string.ascii_letters + string.digits) for n in xrange(10)])
- #if the user puts in 1 he will order the Microsoft - Natural Ergonomic Keyboard 4000
- elif userInput == 2:
- print items_for_sale[1]
- print "You have", credit-20,"left"
- print "Transaction ID:",''.join([random.choice(string.ascii_letters + string.digits) for n in xrange(10)])
- #if the user puts in 2 he will order the Logitech - M325 Wireless Optical Mouse
- elif userInput == 3:
- print items_for_sale[2]
- print "You have", credit -100, "left"
- print "Transaction ID:", ''.join([random.choice(string.ascii_letters + string.digits) for n in xrange(10)])
- #if the user puts in 3 he will order the Dell - SE2717HR 27" IPS LED FHD FreeSync Monitor
- elif userInput ==4:
- print items_for_sale[3]
- print "You have", credit-150, "left "
- print "Transaction ID:", ''.join([random.choice(string.ascii_letters + string.digits) for n in xrange(10)])
- #if the user puts in 4 he will order the Asus - ROG STRIX H270F GAMING USB 3.1 Intel Motherboard
- elif userInput ==5:
- print items_for_sale[4]
- print "You have", credit-500, "left"
- print "Transaction ID:", ''.join([random.choice(string.ascii_letters + string.digits) for n in xrange(10)])
- #if the user puts in 5 he order the Intel® - Core™ i3-6100 3.7GHz Processor
- elif userInput ==6:
- print items_for_sale[5]
- print "You have", credit-40, "left"
- print "Transaction ID:", ''.join([random.choice(string.ascii_letters + string.digits) for n in xrange(10)])
- #if the user puts in 6 he will order PNY - XLR8 NVIDIA GeForce GTX 1050 Ti 4GB GDDR5 PCI Express 3.0 Graphics Card
- elif userInput ==7:
- print items_for_sale[6]
- print "You have", credit-190,'left'
- print "Transaction ID:", ''.join([random.choice(string.ascii_letters + string.digits) for n in xrange(10)])
- #if the user puts in 7 order a Targus - Dual Fan Chill Mat Cooling System
- elif userInput ==8:
- print items_for_sale[7]
- print "You have", credit-20, "left"
- print "Transaction ID:", ''.join([random.choice(string.ascii_letters + string.digits) for n in xrange(10)])
- #if the user puts in 8 they will order a CORSAIR - Carbide Series ATX Mid-Tower Case
- elif userInput ==9:
- print items_for_sale[8]
- print "You have", credit-90, "left"
- print "Transaction ID:", ''.join([random.choice(string.ascii_letters + string.digits) for n in xrange(10)])
- #if the user puts in 9 they order a WD - My Passport 2TB External USB 3.0 Portable Hard Drive
- elif userInput ==10:
- print items_for_sale[9]
- print "You have", credit-220, "left"
- print "Transaction ID:", ''.join([random.choice(string.ascii_letters + string.digits) for n in xrange(10)])
- #if the user puts in 10 they will order Office 365 Home, 1-year subscription, 5 PCs/Macs (Product Key Card)
- final_question=int(input("Would you like keep shopping? 1)Yes 2)No"))
- if final_question == 1:
- print("Choose Your Next Item")
- continue
- elif final_question ==2:
- print("Thank you for shopping! Check your email for shipping details.")
- exit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement