Sunteți pe pagina 1din 4

import easygui

score = 0
grade = 0

#Start
easygui.enterbox("What's your name?")

#True/False1
ans1 = easygui.ynbox("STD stands for Sexually Transmitted Disease")
if ans1 == True:
score = score + 10

#True/False2
ans2 = easygui.ynbox("M.D. stands for Mailard Doctor")
if ans2 == False:
score = score + 10

#True/False3
ans3 = easygui.ynbox("Osmotic pressure always happen in active transport")
if ans3 == False:
score = score + 10

#ShortAnswer1
ans4 = easygui.enterbox("What planet is closest to the sun? ")
if ans4 == "Mercury":
score = score + 10
elif ans4 == "mercury":
score = score + 10

#ShortAnswer2
ans5 = easygui.enterbox("Who is the 44th president of America? ")
if ans5 == "Barak Obama":
score = score + 10
elif ans5 == "Obama":
score = score + 10

#ShortAnswer3
ans6 = easygui.enterbox("1+1 equal to what?")
if ans6 == "2":
score = score + 10

#MCQ1
msg ="Who is the president of USA?"
title = "General Knowledge"
choices = ["Donald Trump", "Obama", "Tim Girad", "King rama 10"]
choice = easygui.choicebox(msg, title, choices)

if choice == "Donald Trump":


score = score + 10

easygui.msgbox(choice)

#MCQ2
msg ="Which one is alkaline solution?"
title = "Science Knowledge"
choices = ["HCl", "NaOH", "HBr", "HI"]
choice = easygui.choicebox(msg, title, choices)

if choice == "NaOH" :
score = score + 10

easygui.msgbox(choice)

#MCQ3
msg ="Which one is not the name of the function in math?"
title = "Math Knowledge"
choices = ["Composite Function", "Logarithmic Function", "Exponential Function", "Exvert
Function"]
choice = easygui.choicebox(msg, title, choices)

if choice == "Exvert Function" :


score = score + 10

easygui.msgbox(choice)
#MCQ4
msg ="Which one is not the properties of sugar?"
title = "Food Knowledge"
choices = ["Caramelization", "Solubility", "Mailnization", "Sweetness"]
choice = easygui.choicebox(msg, title, choices)

if choice == "Mailnization" :
score = score + 10

easygui.msgbox(choice)

#Grading
if 90<= score <=100 :

grade = "A"

elif 85<= score <90 :

grade = "B+"

elif 80 <= score < 85:

grade = "B"

elif 75 <= score < 80:

grade = "C+"

elif 70 <= score < 75:

grade = "C"

elif 65 <= score < 70:

grade = "D+"

elif 60 <= score < 65:

grade = "D"
else :
grade = "F"

#Result
easygui.msgbox( grade + str( ) + str(score) + "%")

S-ar putea să vă placă și