Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #santa naughty list
- import time
- import random
- def presents():
- present_list = ["red toy car", "blue toy car", "green toy car", "purple toy car", "aqua toy car", "pink toy speed boat", "red toy speed boat", "blue toy speed boat", "iphone xs red", "iphone xs grey", "iphone xs blue", "£10,000"] #list of random presents
- secure_random = random.SystemRandom() #casts secure_random as .SystemRandom
- present = secure_random.choice(present_list) #sets present as a random choice
- print ("the elves have found a present for you....", present) #randomly chooses a present from present_list
- #also i would like to imform you that code for presents was fullly mine and others, you can see who did, copied my code by begging me to send it
- def questions():
- global nice #makes code nice
- q1 = input(user+", if you found a £10, would you: \n A: keep the money for what ever you want \n B: give the money to the homeless man or buy food for him with the money \n C: show off to him that you found a £10 note on the floor and its yours \n")
- #make input lower case
- if q1 == "a":
- nice =nice-1 #takes 1 away from nice
- print("that is not the best thing to do, you should really give him the money")
- elif q1 == "b":
- nice =nice+1 #adds 1 to nice
- print("that is the right thing to do, well done")
- elif q1 == "c":
- nice =nice-2 #takes 2 away from nice
- print("that is a horrible thing to do, why would you do that?!")
- else:
- print("you did not pick one of the options, which is bad as you are not listening to santas instructions")
- n=-1
- time.sleep(1)
- print("next questions...")
- q2 = input(user+", if someone was sad in your school, would you: \n A: ignore them and carry on \n B: comfort them and ask how they are \n C: laugh at them and make fun of them")
- if q2 == "a":
- nice =nice-1
- if q2 == "b":
- nice=nice+1
- if q2 == "c":
- nice =nice-2
- print("next question...")
- time.sleep(1)
- q3 = input(user+", is christmas about: \n A: getting presents and money \n B: spending time with your family \n C: flexing to people who are not as fortunate as you?")
- if q3 == "a":
- nice =nice-1
- if q3 == "b":
- nice =nice+1
- if q3 == "c":
- nice =nice-2
- print("checking data") #checks data
- print(nice)
- time.sleep(1) #delays 1 second
- list = open("list.txt","a")
- if nice >= 2:
- good = "y"
- presents()
- Line = user + ": " + "nice \n" #puts the user and nice and new line
- list.write(Line)
- list.close()
- if nice < 2:
- good = "n"
- Line = user + ": " + "bad \n" #purs the user and bad and new line
- list.write(Line)
- list.close()
- def start():
- global user
- global nice
- number = input("How many children are filling this questionare this session? Please enter the answer as a interger")
- number = int(number)
- print("Ok, so" ,number,"Children are filling in this questionare")
- print("loading santa database")
- time.sleep(1)
- print(".")
- time.sleep(1)
- print("..")
- time.sleep(1)
- print("...")
- time.sleep(1)
- print("santa database has loaded")
- for n in range (number):
- nice = 0
- user = input("hello, what is your name")
- time.sleep(1)
- print("hello "+user)
- time.sleep(1)
- print("we are going to ask you some questions to decide if you are naughty or nice")
- time.sleep(1)
- questions()
- #function
- start()
- #finished first person in my class by 1 hour.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement