import random
def quiz():
count = 0
print("Electronic devices are not allowed, please make sure your academic integrety.")
print("WHo is the most handsome person in scls?")
a =input("Type the answer here:")
if(not a =="Wilson"):
print("Correct!")
count = count +1
else:
print("No")
print("Who benefits the Song Dynasty best?")
print("A.WangAnShi")
print("B.QingHui")
print("C.Mr.Travess")
print("D.Su Shi")
b =input("Type the answer here:")
if( b =="D"):
print("Correct!")
count =count+1
elif( b =="A"):
print("In my opinion, I don't think so.")
count = count+0.5
elif( b =="C"):
print("I know, but i can't give you this credit.")
else:
print("No")
print("Which of the following will cause the decrease of economic mobility?")
print("A.Inflation")
print("B.Deflation")
print("C.The decrease of bank rate")
print("D.The import of APCS teaching materials")
c =input("Type the answer here:")
if( c =="B"):
print("Correct!")
count =count +1
elif( c =="D"):
print("Seriously?")
else:
print("No")
print("Which of the following scientist studies in order to revenge to his classmate?")
print("A.Isaac Newton")
print("B.ChenYiXin")
print("C.Albert Einstein")
print("D.David Ricardo")
d =input("Type the answer here:")
if( d =="A"):
print("Correct!")
count =count+1
elif( b =="B"):
print("Perhaps,i don't know.")
else:
print("No")
print("The value of 1/2+1/4+1/8+...+1/n is infinite or not? (Yes or No)")
e =input("Type the answer here:")
if(e =="No"):
print("Correct!")
count= count+1
else:
print("No")
print("A man is pushing a box of 6.67kg in an angle of 34.7 above the ground, set the coefficient of frictional force is 0.12. Please derive the work done by net force in this constant motion.")
f = int(input("Type the answer here:"))
if(f == 0):
print("Correct!")
count = count+1
else:
print("No")
print("Congratulation, you got ",count," out of six.")
print("That is a score of ",count/6," percent.")
def guess_game():
print("game loading..")
low = int(input("What is the lower bond of the number?"))
high = int(input("What is the higher bond of the number"))
print("Generating a number between ",low," and ",high," ...")
lim = int(input("How many times do you want to try for the game?"))
print("Game ready! Let's play.")
name = input("Hello, what is your name?")
print("Hi ",name,", you are going to guess a number between ",low," and ",high)
print("You have ",lim," tries to win the game.")
answer = int(random.randint(low,high))
i = 0
while(i<lim):
guess = int(input("Your guess is:"))
if(guess ==answer):
print("You win the game in ",lim," times")
return" "
elif(guess >=answer):
print("Your guess is too high.")
i = i+1
else:
print("Your guess is too low.")
i = i+1
print("You lose the game.")
quiz()
guess_game()