Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Kevin and Vieri
- import math
- from random import choice # Random is for the transaction code in the generator. Kevin
- from string import ascii_uppercase # ascii_uppercase is for the transaction code for the letters and the string puts it in the random order. Kevin
- from string import digits # digits pulls out random numbers for the generator for the transaction code and the string puts it in the random order. Kevin
- print "-"*30
- print "\x1b[1m Hello, welcome to SkyNet!"
- print "\033[0m-"*30
- money = 1000
- shipping = 10
- parts = ['Razer Keyboard', 'Razer Mouse', 'ASUS Monitor', 'ASUS Motherboard', 'Intel CPU', 'ASUS Graphic Card', 'Cisco System Fan', 'Termaltake Computer Case', 'Seagate Hard Drive', 'Windows 10 Operating System']
- admin_username = 'futhead'
- admin_password = 'cake'
- enter = raw_input("Before I let you in , we need authorization. Enter the Admin name.\n>")
- if enter in admin_username:
- enter2 = raw_input("What is the Password?\n>")
- print enter2
- if enter2 in admin_password:
- print "You're in!"
- else:
- print "INTERLOPER! Securtiy system activated, you have 10 seconds before decimation!"
- exit()
- def again():
- global money
- print "You have $%d left" %money
- if money == 0:
- print "You broke af."
- print "Good-day"
- else:
- purchase()
- def purchase(): # This is a new function the starts for the purchasing process. Vieri
- stay = raw_input("Welcome, would you like to exit or browse?\n>")
- print stay
- if stay == "browse":
- browse = raw_input("Would you like to buy something?(yes/no)\n>")
- print browse
- if browse=="yes":
- print parts
- buy = raw_input("What would you like to buy, we have two of everything.\n>")
- print buy
- global money
- while money > 20: #once you reach below 20 dollars you can't buy anything
- if buy=="Razer Keyboard": # i used the same base of this for each item changing prices and names where needed
- print "Purchase Successful!"
- print (''.join(choice(ascii_uppercase + digits) for i in range(9)))
- money=money-((130+9.1) + shipping)
- print "You have %s dollars left." %money
- print " "
- again()
- elif buy=="Razer Mouse":
- print "Purchase Successful!"
- print (''.join(choice(ascii_uppercase + digits) for i in range(9)))
- money=money-((20+1.4) + shipping)
- print "You have %s dollars left." %money
- print " "
- again()
- elif buy=="ASUS Monitor":
- print "Purchase Successful!"
- print (''.join(choice(ascii_uppercase + digits) for i in range(9)))
- money=money-((400+28) + shipping)
- print "You have %s dollars left." %money
- print " "
- again()
- elif buy=="ASUS Motherboard":
- print "Purchase Successful!"
- print (''.join(choice(ascii_uppercase + digits) for i in range(9)))
- money=money-((200+14) + shipping)
- print "You have %s dollars left." %money
- print " "
- again()
- elif buy=="Intel CPU":
- print "Purchase Successful!"
- print (''.join(choice(ascii_uppercase + digits) for i in range(9)))
- money=money-((250+17.5) + shipping)
- print "You have %s dollars left." %money
- print " "
- again()
- elif buy=="ASUS Graphics Card":
- print "Purchase Successful!"
- print (''.join(choice(ascii_uppercase + digits) for i in range(9)))
- money=money-((400+28) + shipping)
- print "You have %s dollars left." %money
- print " "
- again()
- elif buy=="CISCO System Fan":
- print "Purchase Successful!"
- print (''.join(choice(ascii_uppercase + digits) for i in range(9)))
- money=money-((16+1.12) + shipping)
- print "You have %s dollars left." %money
- print " "
- again()
- elif buy=="Thermaltake Computer Case":
- print "Purchase Successful!"
- print (''.join(choice(ascii_uppercase + digits) for i in range(9)))
- money=money-((150+10.5) + shipping)
- print "You have %s dollars left." %money
- print " "
- again()
- elif buy=="Seagate Hard Drive":
- print "Purchase Successful!"
- print (''.join(choice(ascii_uppercase + digits) for i in range(9)))
- money=money-((100+7) + shipping)
- print "You have %s dollars left." %money
- print " "
- again()
- elif buy=="Windows 10 Operating system":
- print "Purchase Successful!"
- print (''.join(choice(ascii_uppercase + digits) for i in range(9)))
- money=money-((100+7) + shipping)
- print "You have %s dollars left." %money
- print " "
- again()
- elif browse == "no":
- exit()
- if stay == "leave":
- print "Good day!"
- exit()
- purchase() #I had lots of functions which broke the program, so i took them all and combined them into one which is why there's only one.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement